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

Notification

Icon
Error

Original test assembly location before shadow-copy
Michael
#1 Posted : Tuesday, March 13, 2012 11:38:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/13/2012(UTC)
Posts: 2

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hello!

We have a huge solution folder (with lots of XML documents to be tested) located somewhere relative to the assembly with tests. During normal run via NUnit we call Assembly.GetExecutingAssembly() and construct full path to that folder to read and validate these documents. However using NCrunch it is not possible due to the shadow-copy process.

If I'm not mistaken .NET can manage shadow-copy in a way that preserves original location of assembly in it's CodeBase property (URI form). At the same time current location of the assembly is stored in Location property.

Is it possible to provide original test assembly location the same way in NCrunch?
Remco
#2 Posted : Tuesday, March 13, 2012 9:52:36 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for posting! NCrunch's shadow copy works at a different level to the standard .NET shadow copy (which is only performed at runtime). As such, this kind of behaviour currently can't be implemented with the way NCrunch is designed.

There are many ways you can work around this problem, however. NCrunch has some runtime features that allow you to access the original location of the test project being executed. If you are using C#, you can also implement NCrunch-specific logic using '#if NCRUNCH' compiler conditions.


Cheers,

Remco
1 user thanked Remco for this useful post.
Michael on 3/14/2012(UTC)
Michael
#3 Posted : Wednesday, March 14, 2012 5:22:30 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/13/2012(UTC)
Posts: 2

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Excellent!

Thank you very much for a great tool!
1 user thanked Michael for this useful post.
Remco on 3/14/2012(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.026 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download