How does one asserts certain conditions in a static/dynamic test
factory method? Because invoking Assert methods from it results in a
NullReferenceException:
Error: [error] An exception was thrown while exploring tests.
Location: c:\Dev\windows\NC\NC.Entities.Test\FlowFolderTest.cs
Reference:
NetworkCatcher.Entities.Test.FlowFolderTest.CreateStaticTests,
NC.Entities.Test, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=807fc02bc4ce69db
Details: System.NullReferenceException: Object reference not set to
an instance of an object.
at Gallio.Framework.Assertions.AssertionHelper.Verify(Func`1
assertionFunc) in c:\RelEng\Projects\MbUnit v3.1\Work\src\Gallio\Gallio
\Framework\Assertions\AssertionHelper.cs:line 58
at MbUnit.Framework.Assert.AreEqual[T](T expectedValue, T
actualValue, EqualityComparison`1 comparer, String messageFormat,
Object[] messageArgs) in c:\RelEng\Projects\MbUnit v3.1\Work\src\MbUnit
\MbUnit\Framework\Assert.Comparisons.cs:line 108
at MbUnit.Framework.Assert.AreEqual[T](T expectedValue, T
actualValue, String messageFormat, Object[] messageArgs) in c:\RelEng
\Projects\MbUnit v3.1\Work\src\MbUnit\MbUnit\Framework
\Assert.Comparisons.cs:line 52
at MbUnit.Framework.Assert.AreEqual[T](T expectedValue, T
actualValue) in c:\RelEng\Projects\MbUnit v3.1\Work\src\MbUnit\MbUnit
\Framework\Assert.Comparisons.cs:line 38
at NetworkCatcher.Entities.Test.FlowFolderTest.CreateTest
(MethodInfo methodInfo) in c:\Dev\windows\NC\NC.Entities.Test
\FlowFolderTest.cs:line 55
at
NetworkCatcher.Entities.Test.FlowFolderTest.<CreateStaticTests>d__5.MoveNext
() in c:\Dev\windows\NC\NC.Entities.Test\FlowFolderTest.cs:line 87
at Gallio.Common.Collections.GenericCollectionUtils.Exists[T]
(IEnumerable`1 enumeration, Predicate`1 predicate) in c:\RelEng
\Projects\MbUnit v3.1\Work\src\Gallio\Gallio\Common\Collections
\GenericCollectionUtils.cs:line 143
at MbUnit.Framework.Test.BuildStaticTests(IEnumerable`1 tests,
IPatternScope containingScope, ICodeElementInfo declaringCodeElement)
in c:\RelEng\Projects\MbUnit v3.1\Work\src\MbUnit\MbUnit\Framework
\Test.cs:line 97
at
MbUnit.Framework.StaticTestFactoryAttribute.DecorateContainingScope
(IPatternScope containingScope, IMethodInfo method) in c:\RelEng
\Projects\MbUnit v3.1\Work\src\MbUnit\MbUnit\Framework
\StaticTestFactoryAttribute.cs:line 121
at
Gallio.Framework.Pattern.ContributionMethodPatternAttribute.<>c__DisplayClass1.<Consume>b__0
() in c:\RelEng\Projects\MbUnit v3.1\Work\src\Gallio\Gallio\Framework
\Pattern\ContributionMethodPatternAttribute.cs:line 48
at Gallio.Framework.Pattern.BaseBuilder.RunDeferredAction
(ICodeElementInfo codeElement, Action deferredAction) in c:\RelEng
\Projects\MbUnit v3.1\Work\src\Gallio\Gallio\Framework\Pattern
\BaseBuilder.cs:line 66
Is it by design?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mbunituser?hl=en
-~----------~----~----~----~------~----~------~--~---