Пример #1
0
        public void RenderEmailWithModelAndLayout()
        {
            var car = new Car {
                Make = "Ford", Model = "Mustang"
            };
            var email = _templateEngine.RenderEmailAsync("CarMail.cshtml", model: car).Result;

            Assert.IsTrue(email != null);
            var body = email.AlternateViews[0].ContentStream.AsString();

            Debug.WriteLine(body);
            Assert.IsTrue(body.Contains("Car Email"));
            Assert.IsTrue(body.Contains("Ford"));
            Assert.IsTrue(body.Contains("Mustang"));
        }