I wanted to add property-based testing to my NUnit / FsUnit test projects by starting out with FsCheck.
I added FsCheck and the FsCheck NUnit projects to my existing test project. I also added a few of the standard example tests from the Github source of FsCheck to see if everything worked. The tests loaded fine in NUnit test runner, but in NCrunch I saw the following:
Code:
An error occurred while analysing this project after it was built:
System.ArgumentException: FsCheck.NUnit.Addin.FsCheckTestCaseBuilder is not {0} extension point
Parameter name: extension
at NUnit.Core.ExtensionPoint.Install(Object extension)
at FsCheck.NUnit.Examples.FsCheckAddin.NUnit-Core-Extensibility-IAddin-Install
(IExtensionHost host) in D:\...xxx.UnitTests\FsCheckAddin.fs:line 26
at NUnit.Core.CoreExtensions.InstallAddin(Type type)
at NUnit.Core.CoreExtensions.InstallAdhocExtensions(Assembly assembly)
at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
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.Module.NUnit.Integration.NUnitTestFramework.ensureRunnerExists
(FilePath testAssemblyPath)
at nCrunch.Module.NUnit.Integration.NUnitTestFramework.
FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath
assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName
testComponentUniqueName)
at nCrunch.TestExecution.TestFinder..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly
assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths,
TestFrameworkDescription[] frameworks, ComponentUniqueName testComponentUniqueName)
at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(TestFrameworkDescription[]
applicableFrameworks, ComponentUniqueName testComponentUniqueName, PerfTracker
perfTracker)
The packages I referenced were:
Code:
<packages>
<package id="FSharp.Core" version="4.0.0.1" targetFramework="net46" />
<package id="FsUnit" version="1.4.0.0" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" />
</packages>
I noticed this post:
http://forum.ncrunch.net...nalysed-for-tests.aspx. I did what you (Remco) did, set "Copy referenced assemblies to workspace" to true. Now the "normal" tests and testsources are loaded and run. Next I tried what was suggested here (https://blog.gertjvr.com/how-to-setup-ncrunch-with-autofixture-nunit2-post/), which is to change from "UseDynamicAnalysis" to "UseStaticAnalysis", , but this had the effect that none of the test-source tests where generated, so this was no viable option.
I have not yet checked to update the NUnit versions to 2.6.4, I will do that now, but decided to raise this anyway as I may not be the only one with this issue and perhaps you have found a better way of dealing with this since the last time you tried out FsCheck. I am also writing since I am wondering whether it should work "out of the box" when using an NUnitAddIn or whether I should stay away from such extensions when using NCrunch (just to know where to further analyse this).
(post altered, edited stacktrace so that it becomes somewhat readable, this forum doesn't seem to create scrollbars around the bbcode codeblocks)EDIT: I tried copying the 2.6.4 versions of NUnit but the result was that NCrunch showed zero tests for all (here three) test projects. After restoring this and trying the original, the property-based tests are still not seen.