public void RemoveMessageAndPreview()
        {
            const int messageId = 8;
            var campaignService = new Mock<ICampaignService>();
            var controller = new CampaignController(campaignService.Object, null, null, null, null, ServiceBuilder.Saver.Object);
            var message = new MessageBuilder().WithId(messageId).Build();

            campaignService.Expect(cs => cs.RetrieveMessageById(messageId))
                .Returns(message);
            campaignService.Expect(cs => cs.MarkMessageForDeletion(message));

            var result = (RedirectToRouteResult)controller.RemoveMessageAndPreview(messageId, 1);
            AssertRedirectToRoute(result, "Preview");
            campaignService.VerifyAll();
        }
示例#2
0
 public void when_validate_called_then_IsValid()
 {
     var message = new MessageBuilder().Build();
     Assert.IsTrue(message.IsValid);
 }