Пример #1
0
        public void GetMailMessage_CanReturnMailMessage()
        {
            // arrange
            var parser = new Mock<IParser>();
            var message = new RazorMailMessage(ObjectMother.Subject);
            parser.Setup(x => x.BaseUrls(It.IsAny<string>())).Returns<string>(x => x);
            parser.Setup(x => x.StripHtml(It.IsAny<string>())).Returns<string>(x => x);

            // act
            message.To.Add(ObjectMother.To);
            message.Templates.Add("Test template");
            var result = message.GetMailMessage(parser.Object);

            // assert
            Assert.That(result, Is.Not.Null);
            Assert.That(result, Is.TypeOf<MailMessage>());
        }