コード例 #1
0
 public void Index_ShouldReturn_ViewNamed_Index() {
     //Arrange
     CustomerController controller = new CustomerController(_loggingServiceFake, _customerServiceFake);
     //Act
     ActionResult result = controller.Index(1);
     //Assert
     result.AssertViewRendered().ForView("Index");
 }
コード例 #2
0
 public void IndexPost_ShouldRedirectTo_Step2()
 {
     //Arrange
     CustomerController controller = new CustomerController(_loggingServiceFake, _customerServiceFake);
     //Act
     ActionResult result = controller.Index(new Core.Entities.Customer { Id = 1 });
     //Assert
     result.AssertActionRedirect().ToAction("Step2");
 }
コード例 #3
0
 public void Index_ShouldReturn_ViewWithModelofType_Customer()
 {
     //Arrange
     CustomerController controller = new CustomerController(_loggingServiceFake, _customerServiceFake);
     //Act
     ViewResult result = (ViewResult)controller.Index(1);
     //Assert
     result.Model.Should().BeOfType<Core.Entities.Customer>();
     //Assert.IsInstanceOfType(result.Model, typeof(Core.Entities.Customer));
 }