Esempio n. 1
0
        public void for_StartPageController_when_index_it_should_return_a_pageviewmodel()
        {
            var viewResult = _controller.Index() as ViewResult;
            var model      = viewResult.Model as PageViewModel;

            Assert.NotNull(model);
        }
Esempio n. 2
0
        public async Task GetAStartPage()
        {
            var indexPage = await _controller.Index("start-page") as ViewResult;

            var result = indexPage.ViewData.Model as ProcessedStartPage;

            result.Title.Should().Be("Start Page");
            result.Slug.Should().Be("start-page");
            result.Teaser.Should().Be("this is a teaser");
            result.Summary.Should().Be("This is a summary");
            result.UpperBody.Should().Be(MarkdownWrapper.ToHtml("An upper body"));
            result.FormLinkLabel.Should().Be("Start now");
            result.FormLink.Should().Be("http://start.com");
            result.LowerBody.Should().Be(MarkdownWrapper.ToHtml("Lower body"));
            result.Breadcrumbs.Should().HaveCount(1);
            result.Alerts.First().Title.Should().Be("title");
            result.Alerts.First().Body.Should().Contain("body");
            result.Alerts.First().SubHeading.Should().Be("subHeading");
            result.Alerts.First().Severity.Should().Be("severity");
        }