public void Show_IfNotExists_ReturnsNotFoundView() { //Arrange var controller = new PageController { RavenSession = _documentStore.OpenSession() }; //Act var result = (HttpNotFoundResult)controller.Show("about-us/team/managment"); //Assert Assert.AreEqual(404, result.StatusCode); }
public void Show_IfExists_ReturnsView() { //Arrange StoreSamplePage(); var controller = new PageController { RavenSession = _documentStore.OpenSession() }; //Act var result = (ViewResult)controller.Show("about-us/team/managment"); var model = (PageViewModel)result.Model; //Assert Assert.AreEqual(1, model.Id); Assert.AreEqual("My page", model.Body); Assert.AreEqual("about-us/team/managment", model.Url); }