úterý 27. ledna 2015

FSharp.Data and Unit Testing issues

I have recently run into two separate issues while testing some F# data providers based code. I am using ReSharper's NUnit runner and sometimes NCrunch.

NCrunch issues

NCrunch won't compile your solution when FSharp.Data is referenced. This component internally references FSharp.Data.DesignTime which has to be avaiable for the compilation - and NCrunch does not have those libs available, because the DLL is not referenced the standard way, but must be provided by Visual Studio.

The current solution is to reference FSharp.Data.DesignTime manually. If you are using nuget, than the DLL can be found in the pacakages foder as shown bellow:

Note that I have tested and had the same issue with FSharp.Data 2.1.0 and 2.2.0.

NUnit runner issues

NUnit did load the test correctly, but the test failed with SystemMissingMethodException

Luckily the solution can be found on StackOverflow and was caused by the tested library being Portable Class Library instead of standard F# library.