Beispiel #1
0
		public void new_get_should_return_viewresult()
		{
			// Arrange
			string title = "my title";

			// Act
			ActionResult result = _pagesController.New(title);

			// Assert
			Assert.That(result, Is.TypeOf<ViewResult>(), "ActionResult is not a ViewResult");
			ViewResult viewResult = result as ViewResult;
			Assert.NotNull(viewResult, "Null viewResult");
			Assert.That(viewResult.ViewName, Is.EqualTo("Edit"));
			
			PageViewModel model = viewResult.ModelFromActionResult<PageViewModel>();
			Assert.NotNull(model, "Null model");
			Assert.That(model.Title, Is.EqualTo(title));
		}