When i have a test with the TestCase attribute Ncrunch fails to run any of the tests. here is the error that is seen
[17:03:46.1891-TestExecutionTask-13] ERROR (Internal): System.Reflection.CustomAttributeFormatException: 'Result' property specified was not found. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
--- End of inner exception stack trace ---
at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
at System.Reflection.RuntimeMethodInfo.GetCustomAttributes(Boolean inherit)
at NUnit.Core.Reflect.GetAttributes(ICustomAttributeProvider member, Boolean inherit)
at NUnit.Core.Reflect.HasAttribute(ICustomAttributeProvider member, String attrName, Boolean inherit)
at NUnit.Core.Reflect.GetMethodsWithAttribute(Type fixtureType, String attributeName, Boolean inherit)
at NUnit.Core.NUnitTestFixture..ctor(Type fixtureType, Object[] arguments)
at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildSingleFixture(Type type, Attribute attr)
at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildFrom(Type type)
at NUnit.Core.Extensibility.SuiteBuilderCollection.BuildFrom(Type type)
at NUnit.Core.TestFixtureBuilder.BuildFrom(Type type)
at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.InitialiseFrameworkForExecution(String solutionDirectory, String testAssemblyPath, Int32 defaultTimeout)
at nCrunch.TestExecution.RemoteTestRunner.#=qn1yXL7OMLYnsnvw4beLiAAeJO1e0Wb0wyJoMYaKZ6Hs=(Type #=qwigHKwK_oJMjwQiNaa0kBGZ1T2uFgas3$$xtOpakwe8=)
at nCrunch.TestExecution.RemoteTestRunner.RunTests(IMasterExecutionMap[] masterExecutionMaps, IList`1 testsToRun)
This is what my test looks like:
[TestCase(2, Description = "SquareOf2", Result = 4)]
[Test]
public int ShouldRoundTaxToNearest05(decimal valueToBeSquared)
{
return obj.Square(valueToBeSquared);
}
From the error it seems its not able to pick up the Result attribute correctly.
FYi if i comment out TestCase line everything works smoothly..
Let me know if you need any more clarifications.
P.S: Awesome tool but please make it a little faster especially on solutions with 20+ projects