shekharpro / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

ReSharper displays contract verifier class names as errors #389

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open the Sample tests in Visual Studio 2008 SP1 with Resharper 4.1.933.3
2. Open the contract verifier tests: SampleException.Test.cs, 
SampleEquatable.Test.cs and SampleComparable.Test.cs (all contract 
verifier tests exhibit this base problem)

What is the expected output? What do you see instead?
Expect that the class be shown without errors.
Actually see the class name with a squiggly underline indicating a 
problem. Hovering over the class name displays details of an exception 
(see attached screenshot). The test can not be run with the ReSharper test 
runner, but can be executed with Icarus, Echo, etc.

What version of the product are you using? On what operating system?
Gallio version 3.0.5 build 546 on Windows Vista Ultimate x64

Please provide any additional information below.

Problem occurs with all contract verifiers. Additional information is 
output when the project contains the project type GUID for a test. I.e.:

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-
11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

The following information is output:

---
[error] An exception was thrown while exploring tests.
    Reference: 
MbUnit.Samples.ContractVerifiers.SampleComparableTest, MbUnit.Samples, 
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: System.NotSupportedException: Specified method is not 
supported.
   at System.Reflection.Emit.TypeBuilderInstantiation.IsAssignableFrom
(Type c)
   at 
MbUnit.Framework.ContractVerifiers.VerifyComparisonContractAttribute.GetICo
mparableInterface() in c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyComparisonContrac
tAttribute.cs:line 237
   at 
MbUnit.Framework.ContractVerifiers.VerifyComparisonContractAttribute.Valida
te(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyComparisonContrac
tAttribute.cs:line 173
   at Gallio.Framework.Pattern.TestDecoratorPatternAttribute.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\TestDecoratorPatternAttribute.cs:
line 35
   at Gallio.Framework.Pattern.PatternEvaluator.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\PatternEvaluator.cs:line 223
[error] An exception was thrown while exploring tests.
    Reference: MbUnit.Samples.ContractVerifiers.SampleEquatableTest, 
MbUnit.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: System.NotSupportedException: Specified method is not 
supported.
   at System.Reflection.Emit.TypeBuilderInstantiation.IsAssignableFrom
(Type c)
   at 
MbUnit.Framework.ContractVerifiers.VerifyEqualityContractAttribute.GetIEqua
tableInterface() in c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyEqualityContractA
ttribute.cs:line 237
   at 
MbUnit.Framework.ContractVerifiers.VerifyEqualityContractAttribute.Validate
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyEqualityContractA
ttribute.cs:line 184
   at Gallio.Framework.Pattern.TestDecoratorPatternAttribute.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\TestDecoratorPatternAttribute.cs:
line 35
   at Gallio.Framework.Pattern.PatternEvaluator.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\PatternEvaluator.cs:line 223
[warning] The test was ignored.
Reason: Skipped
    Reference: MbUnit.Samples.OutcomeDemo.Skipped, MbUnit.Samples, 
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
[error] An exception was thrown while exploring tests.
    Reference: MbUnit.Samples.ContractVerifiers.SampleExceptionTest, 
MbUnit.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: System.NotImplementedException: The method or operation 
is not implemented.
   at Gallio.Reflection.Impl.UnresolvedType.IsSubclassOf(Type c) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Reflection\Impl\UnresolvedType.cs:line 396
   at 
MbUnit.Framework.ContractVerifiers.VerifyExceptionContractAttribute.Validat
e(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyExceptionContract
Attribute.cs:line 163
   at Gallio.Framework.Pattern.TestDecoratorPatternAttribute.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\TestDecoratorPatternAttribute.cs:
line 35
   at Gallio.Framework.Pattern.PatternEvaluator.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\PatternEvaluator.cs:line 223
[error] An exception was thrown while exploring tests.
    Reference: 
MbUnit.Samples.ContractVerifiers.SampleComparableTest, MbUnit.Samples, 
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: System.NotSupportedException: Specified method is not 
supported.
   at System.Reflection.Emit.TypeBuilderInstantiation.IsAssignableFrom
(Type c)
   at 
MbUnit.Framework.ContractVerifiers.VerifyComparisonContractAttribute.GetICo
mparableInterface() in c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyComparisonContrac
tAttribute.cs:line 237
   at 
MbUnit.Framework.ContractVerifiers.VerifyComparisonContractAttribute.Valida
te(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyComparisonContrac
tAttribute.cs:line 173
   at Gallio.Framework.Pattern.TestDecoratorPatternAttribute.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\TestDecoratorPatternAttribute.cs:
line 35
   at Gallio.Framework.Pattern.PatternEvaluator.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\PatternEvaluator.cs:line 223
[error] An exception was thrown while exploring tests.
    Reference: MbUnit.Samples.ContractVerifiers.SampleEquatableTest, 
MbUnit.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: System.NotSupportedException: Specified method is not 
supported.
   at System.Reflection.Emit.TypeBuilderInstantiation.IsAssignableFrom
(Type c)
   at 
MbUnit.Framework.ContractVerifiers.VerifyEqualityContractAttribute.GetIEqua
tableInterface() in c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyEqualityContractA
ttribute.cs:line 237
   at 
MbUnit.Framework.ContractVerifiers.VerifyEqualityContractAttribute.Validate
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyEqualityContractA
ttribute.cs:line 184
   at Gallio.Framework.Pattern.TestDecoratorPatternAttribute.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\TestDecoratorPatternAttribute.cs:
line 35
   at Gallio.Framework.Pattern.PatternEvaluator.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\PatternEvaluator.cs:line 223
[warning] The test was ignored.
Reason: Skipped
    Reference: MbUnit.Samples.OutcomeDemo.Skipped, MbUnit.Samples, 
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
[error] An exception was thrown while exploring tests.
    Reference: MbUnit.Samples.ContractVerifiers.SampleExceptionTest, 
MbUnit.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: System.NotImplementedException: The method or operation 
is not implemented.
   at Gallio.Reflection.Impl.UnresolvedType.IsSubclassOf(Type c) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Reflection\Impl\UnresolvedType.cs:line 396
   at 
MbUnit.Framework.ContractVerifiers.VerifyExceptionContractAttribute.Validat
e(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\MbUnit\MbUnit\Framework\ContractVerifiers\VerifyExceptionContract
Attribute.cs:line 163
   at Gallio.Framework.Pattern.TestDecoratorPatternAttribute.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\TestDecoratorPatternAttribute.cs:
line 35
   at Gallio.Framework.Pattern.PatternEvaluator.Process
(PatternEvaluationScope scope, ICodeElementInfo codeElement) in 
c:\RelEng\Projects\MbUnit v3
\Work\src\Gallio\Gallio\Framework\Pattern\PatternEvaluator.cs:line 223

Original issue reported on code.google.com by rhys.c.p...@gmail.com on 5 Feb 2009 at 6:02

Attachments:

GoogleCodeExporter commented 8 years ago
This problem will not exist in MbUnit v3.0.6 anymore due to changes in the 
syntax of
contract verifiers.  As a result Type.IsSubclassOf won't be called anymore.

The deeper problem here is that we need a more lightweight means of populating 
the R#
test tree that avoids performing certain checks that cannot be implemented in 
that
environment because the test code has not been compiled yet and cannot be 
completely
evaluated.

Original comment by jeff.br...@gmail.com on 4 Mar 2009 at 6:26