Environment:
OS: Windows 7 Enterprise 64-bit
IDE: Visual Studio 2010 Premium
JustMocks: "Trial Version Q1 2012 Visual Studio 11 Refresh - Build (2012.1.229.0)"
I have a Enabled JustMock in Visual Studio 2010 and am attempting to run the following test against SharePoints SPWebApplication:
I get the following exception message:
Telerik.JustMock.MockException: There were some problems intercepting the mock call. Optionally, please make sure that you have turned on JustMock's profiler while mocking concrete members.
When I run it via the xUnit GUI Runner it passes. I use the following command to run xUnit via an external tool in VS:
JustMockRunner.exe xunit.gui.clr4.exe $(BinDir)$(TargetName)$(TargetExt)
and here is the xUnit version of the test:
Any ideas would be appreciated.
OS: Windows 7 Enterprise 64-bit
IDE: Visual Studio 2010 Premium
JustMocks: "Trial Version Q1 2012 Visual Studio 11 Refresh - Build (2012.1.229.0)"
I have a Enabled JustMock in Visual Studio 2010 and am attempting to run the following test against SharePoints SPWebApplication:
[TestMethod][TestCategory("JustMocked")]public void ValidSPWebApp_SetsEmailAddresses_JustMocked(){ var fakeSPWebApp = Mock.Create<SPWebApplication>(Constructor.Mocked); Mock.Arrange(() => fakeSPWebApp.OutboundMailServiceInstance.Server.Address).Returns(SmtpHostName); Mock.Arrange(() => fakeSPWebApp.OutboundMailSenderAddress).Returns(EmailAddressForSender); Mock.Arrange(() => fakeSPWebApp.OutboundMailReplyToAddress).Returns(EmailAddressForReplyTo); var sut = new SimpleEmailHelper(fakeSPWebApp); Assert.AreEqual(EmailAddressForSender, sut.SenderMailAddress.Address); Assert.AreEqual(EmailAddressForReplyTo, sut.ReplyToAddress.Address);}I get the following exception message:
Telerik.JustMock.MockException: There were some problems intercepting the mock call. Optionally, please make sure that you have turned on JustMock's profiler while mocking concrete members.
When I run it via the xUnit GUI Runner it passes. I use the following command to run xUnit via an external tool in VS:
JustMockRunner.exe xunit.gui.clr4.exe $(BinDir)$(TargetName)$(TargetExt)
and here is the xUnit version of the test:
[Fact][Trait("Tag", "JustMocked")]public void ValidSPWebApp_SetsEmailAddresses_JustMocked(){ var fakeSPWebApp = Mock.Create<SPWebApplication>(); Mock.Arrange(() => fakeSPWebApp.OutboundMailServiceInstance.Server.Address).Returns(SmtpHostName); Mock.Arrange(() => fakeSPWebApp.OutboundMailSenderAddress).Returns(EmailAddressForSender); Mock.Arrange(() => fakeSPWebApp.OutboundMailReplyToAddress).Returns(EmailAddressForReplyTo); var sut = new SimpleEmailHelper(fakeSPWebApp); Assert.Equal(EmailAddressForSender, sut.SenderMailAddress.Address); Assert.Equal(EmailAddressForReplyTo, sut.ReplyToAddress.Address);}Any ideas would be appreciated.