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

Notification

Icon
Error

Problem with MFakes when Fakes compiled outside test project
dmitrijz
#1 Posted : Tuesday, July 5, 2016 10:42:35 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/5/2016(UTC)
Posts: 1
Location: Lithuania

Hello,
I have issues with NCrunch, latest version, when I generate Fakes inside test project, everything works and tests pass.
But for very large projects, we using special project to generate system fake assemblies and put them to dependencies folder, so in each test project we using static reference from dependencies folder and do not have any Fakes folder with xml configuration. Ncrunc always fails at using (ShimsContext.Create()) line.

Please tell whether it is possible to configure NCrunch to work with pre-compiled fake dlls. We are large company and currently I am trying to find solution for this problem, so I bought single license to test your tool on our project but now this issue is a blocker for us.

Thanks,
Dmitry
Remco
#2 Posted : Tuesday, July 5, 2016 1:02:30 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Dmitry,

Unfortunately it's difficult for me to promise that I can find a way to make NCrunch work with such a scenario. MS Fakes itself is a Microsoft product and NCrunch's integration with this product was particularly challenging as there is no 'official' way in which Microsoft supports Fakes being loaded into the test environment by a third party tool. The goal of integrating with MS Fakes was to try and make this product work in its standard use case, which is where the fakes assemblies are generated at build time through the standard MSBuild tasks.

With that said, have you tried creating a single reference to a fakes assembly (perhaps a small one) from your test project that hasn't been pre-built using your custom method? NCrunch detects the requirement for MSFakes by looking for the <Fakes> project item inside the test project. If the <Fakes> configuration files are declared in the project, NCrunch will then initialise the intellitrace profiler to allow fakes to operate at run time. What I'm not certain of is how the intellitrace profiler will behave if the Fakes assemblies themselves are pre-generated and do not have any configuration - unfortunately this is outside of my knowledge of how this product works. I recommend trying this approach to see if it works for you.
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.027 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download