Crunch
About
Pricing
Documentation
News
Support
Download
Customer Login
Welcome Guest! To enable all features please
Login
or
Register
.
Forum
Active Topics
Search
Login
Register
Notification
Error
OK
NCrunch Forum
»
General Support
»
Build/Test Issues
»
Issue with structure map dependency resolver test
Issue with structure map dependency resolver test
Options
Previous Topic
Next Topic
kburnell
#1
Posted :
Wednesday, April 25, 2012 2:49:12 AM(UTC)
Rank: Newbie
Groups: Registered
Joined: 4/25/2012(UTC)
Posts: 2
In my NCrunch window one of my tests is always marked as failing, even though it passes when ran. The specific test involves testing my StructureMap dependency resolver. The code from the class under test and the test class are provided below.
Class Under Test
public static class Resolver {
public static T GetConcreteInstanceOf<T>() {
return ObjectFactory.GetInstance<T>();
}
}
Test Class
[TestClass]
public class ResolverTest {
[TestMethod]
public void GetConcreteInstanceOf_ShouldReturn_LoggingService_WhenT_Is_ILoggingService() {
//Arrange
ObjectFactory.Initialize(registry => registry.Scan(x =>
{
x.AssembliesFromApplicationBaseDirectory();
x.WithDefaultConventions();
}));
//Act
ILoggingService result = Resolver.GetConcreteInstanceOf<ILoggingService>();
//Assert
result.ShouldBeType<LoggingService>();
}
}
Back to top
User Profile
View All Posts by User
View Thanks
Remco
#2
Posted :
Wednesday, April 25, 2012 4:57:29 AM(UTC)
Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161
Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting!
It looks to me like this test is making assumptions about the location of assemblies within its application domain. I suggest having a read of the test issue troubleshooting guide, as it has a section that covers this -
https://www.ncrunch.net/documentation/troubleshooting_test-and-runtime-related-issues
I hope this helps.
Cheers,
Remco
Back to top
User Profile
View All Posts by User
View Thanks
Users browsing this topic
Guest
NCrunch Forum
»
General Support
»
Build/Test Issues
»
Issue with structure map dependency resolver test
Forum Jump
General Support
- Setup Problems
- Build/Test Issues
- Daily Usage Issues
Crunch Discussion
- General Feedback
- Feature Suggestions
General Discussion
- General Discussion
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.
Watch this topic
Email this topic
Print this topic
» Normal
Threaded
YAF
|
YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.023 seconds.
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download