Hi,
in my test project I use Etg.SimpleStubs (https://github.com/Microsoft/SimpleStubs) as this seems to be the only mocking framework working for my target platform, UWP.
SimpleStubs works by generating source which it puts into a specific file. As far as I understand, it creates/refreshes that file upon build. One has to manually add that file to the project (which I did).
My tests do build and run in ReSharper (right-click the test-project, Run tests).
They do not build in NCrunch. The error messages say that the generated stub types do not exist. So my guess is somehow that file is not being generated.
I tried enabling post/pre build steps for NCrunch, to no avail.
Maybe it helps to know for you to reproduce the issue that I used the procedure described under
https://xunit.github.io/docs/getting-started-uwp.html
to create my test-project.
Any help would be greatly appreciated,
thanks,
Max from Vienna/Bratislava
Remco NCrunch Developer
#9635
27 Dec 2016 05:50 UTC
Hi Max,
Thanks for sharing this issue.
My assumption here is that this library likely uses a custom build step to generate its mocks. It isn't clear to me why this step would fail to run under NCrunch, but it may be worth trying compatibility mode to see if any NCrunch settings have an effect on it.
Failing this, I'd suggest taking a look at the workspace NCrunch generates for your project (right click the project in the NCrunch Tests Window, go to Advanced->Browse to workspace). You can try running MSBuild against the project file NCrunch has generated in this workspace. Doing so will give you a way to build the project as NCrunch does, and you can make modifications to the project or the workspace to see what is different about the NCrunch workspace that prevents this critical build step from running.
Thanks for sharing this issue.
My assumption here is that this library likely uses a custom build step to generate its mocks. It isn't clear to me why this step would fail to run under NCrunch, but it may be worth trying compatibility mode to see if any NCrunch settings have an effect on it.
Failing this, I'd suggest taking a look at the workspace NCrunch generates for your project (right click the project in the NCrunch Tests Window, go to Advanced->Browse to workspace). You can try running MSBuild against the project file NCrunch has generated in this workspace. Doing so will give you a way to build the project as NCrunch does, and you can make modifications to the project or the workspace to see what is different about the NCrunch workspace that prevents this critical build step from running.
I gave up on SimpleStubs, it creates other problems as well. I got another issue now, but I'll create a separate thread for that.
Post a reply
Log in to reply.