You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've written a base class for running NSpec examples using NUnit. I just upgraded it to use NUnit 3, which worked fine. But when I try to target netstandard 1.6, I get the following when running tests:
System.NullReferenceException : Object reference not set to an instance of an object.
at NUnit.Compatibility.TypeExtensions.NotPrivate(MemberInfo info)
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at NUnit.Compatibility.TypeExtensions.GetAllMembers(Type type)
at NUnit.Compatibility.TypeExtensions.GetAllMembers(Type type)
at NUnit.Compatibility.TypeExtensions.GetMember(Type type, String name, BindingFlags ignored)
at NUnit.Framework.TestCaseSourceAttribute.GetTestCaseSource(IMethodInfo method)
at NUnit.Framework.TestCaseSourceAttribute.GetTestCasesFor(IMethodInfo method)
The TestCaseSource attribute lives in a class that inherits the nspec class from NSpec, and it has properties without getters, e.g.:
public virtual Expression<Action> specify
{
set
{
this.AddExample((ExampleBase) new Example(value, false));
}
}
I've written a base class for running NSpec examples using NUnit. I just upgraded it to use NUnit 3, which worked fine. But when I try to target netstandard 1.6, I get the following when running tests:
The TestCaseSource attribute lives in a class that inherits the
nspec
class from NSpec, and it has properties without getters, e.g.:I'm guessing that the exception happens here:
nunit/src/NUnitFramework/framework/Compatibility/ReflectionExtensions.cs
Line 200 in 8a91958
That code is only used with netstandard 1.6, which explains why things worked well before that.
The text was updated successfully, but these errors were encountered: