public void Index_NoDescription_AddsToHeadAndDisplaysMarkup() { var controller = new StyleSheetTestController(); controller.Model.InlineStyles = StyleSheetTestModel.Markup; var result = (ViewResult)controller.Index(); Assert.AreEqual(StyleSheetTestModel.Markup, controller.HeadContent, "CSS markup was not added to the Head of the page."); var content = result.ViewBag.DesignModeContent; Assert.IsNotNull(content, "The result was not of the expected type."); Assert.IsTrue(content.Contains(StyleSheetTestModel.Markup), "The Content did not contain the CSS markup."); }
public void Index_Description_AddsToHeadAndDisplaysDescription() { var description = "Test Description"; var controller = new StyleSheetTestController(); controller.Model.Description = description; var result = (ViewResult)controller.Index(); Assert.AreEqual(StyleSheetTestModel.Markup, controller.HeadContent, "CSS markup was not added to the Head of the page."); var content = result.ViewBag.DesignModeContent; Assert.IsNotNull(content, "The result was not of the expected type."); Assert.AreEqual(description, content, "The result is not the expected description."); }