or
the ProcessFilterResult checks some dates and a flag on the target, all of which pass. It uses some regex to find matches in the MailMessage.BodyText, which also match the asserted method call. Stepping through the code, I watch the result and data proxies match up to the Mocked objects and then watch the target._dal.RecordBouncedEmail() method call being called, but when I get back to the test code I still get the following exception. Telerik.JustMock.MockAssertionException was unhandled by user code
[TestMethod]
public
void
ProcessFilterResult_MailMessageDate_AfterLatestDBDate_ProcessesMessage_Test()
{
BounceHandler_Accessor target =
new
BounceHandler_Accessor();
var data = Mock.Create<IDataAccess>();
target._dal = data;
Mock.Arrange( () => data.GetLatestEmailDate() ).Returns( DateTime.Now.AddDays( -7 ) );
target._recordToDatabase =
true
;
var result = Mock.Create<BounceFilterResult>();
Cforge.Net.Mail.MailMessage msg =
new
Cforge.Net.Mail.MailMessage();
msg.Date =
new
Cforge.Net.Mime.Headers.MailDateTime(DateTime.Now);
msg.BodyText = @"X-ETC-MailingID: 00001
X-ETC-MailflowID: 10000";
Mock.Arrange( () => result.MailMessage ).Returns( msg );
target.ProcessFilterResult( result );
Mock.Assert( () => data.RecordBouncedEmail( result,
"00001"
,
"10000"
), Occurs.Once() );
}
Message=Expected call on the mock should be once, but it was called 0 time(s).
Source=Telerik.JustMock Can anyone give me some idea what the problem might be?
TransactionHeaderViewModel
ticket = Mock.Create<TransactionHeaderViewModel>();
Mock
.SetupStatic(typeof(System.Web.Security.Membership));
I get the following exception message:
"The type 'System.Web.Security.MembershipCreateStatus&' may not be used as a type argument."
I'm trying to verify that Membership.CreateUser is being called inside a method.
Thanks,
Joe