Ejemplo n.º 1
0
 public void CustomerController_ChangeOwner_Exception_AppendsErrorMessageToHeader()
 {
     _mockCustomerService.Setup(s => s.GetById(It.IsAny <int>())).Throws(new ApplicationException("Oh no!!"));
     _controllerWithMockedCustomerService.ChangeOwner(new ChangeCustomerOwnerViewModel());
     _mockResponseManager.Verify(v => v.AppendHeader(ModelStateErrorNames.ErrorMessage, It.IsAny <string>()), Times.Once);
 }