I am facing a strange problem when executing unit testes using JustMockRunner from Exec task under CruiseControl.Net
The same command line make the test pass, but from inside the CruiseControl.Net the test failed.
I am using Future Mocking for this unit test.
I reviewed the event viewer and found no errors regarding Profile Loading, the test fails because it didn't use my Future mocking and calls the direct methods.
Below is the code I am using for future Mocking
This test uses Future mocking when running under VS 2012 and from command prompt
What I am missing!
The same command line make the test pass, but from inside the CruiseControl.Net the test failed.
I am using Future Mocking for this unit test.
I reviewed the event viewer and found no errors regarding Profile Loading, the test fails because it didn't use my Future mocking and calls the direct methods.
Below is the code I am using for future Mocking
[TestMethod]
public
void
Load_Default_Profile_For_New_User()
{
var userProfileService = Mock.Create<UserProfileServiceBase>(Behavior.Loose);
Mock.Arrange(() => userProfileService.GetByUserId(Arg.AnyInt)).IgnoreInstance().Returns<
int
>(id => {
return
null
; });
Mock.Arrange(() => userProfileService.Insert(Arg.IsAny<UserProfile>())).IgnoreInstance().Returns(
true
);
Assert.IsTrue(Mock.IsProfilerEnabled,
"Profiler not enabled"
);
var userService =
new
PaXtreme.Services.UserService();
var userProfile = userService.GetUserProfile(1);
Assert.IsNotNull(userProfile);
Assert.IsFalse(
string
.IsNullOrEmpty(userProfile.ProfileData));
}
This test uses Future mocking when running under VS 2012 and from command prompt
What I am missing!