Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Tests using Etg.SimpleStubs don't build
ModernRonin
#1 Posted : Tuesday, December 27, 2016 3:07:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 2
Location: Austria

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
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/...etting-started-uwp.html
to create my test-project.

Any help would be greatly appreciated,
thanks,
Max from Vienna/Bratislava

Remco
#2 Posted : Tuesday, December 27, 2016 5:50:17 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
ModernRonin
#3 Posted : Thursday, December 29, 2016 5:44:22 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 2
Location: Austria

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
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.
1 user thanked ModernRonin for this useful post.
Remco on 12/29/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download