public IHttpActionResult PutSUPPLIER( [PexAssumeUnderTest] SUPPLIERsController target, string id, SUPPLIER sUPPLIER ) { IHttpActionResult result = target.PutSUPPLIER(id, sUPPLIER); return(result); // TODO: add assertions to method SUPPLIERsControllerTest.PutSUPPLIER(SUPPLIERsController, String, SUPPLIER) }
public void UpdateSupplierTest() { SupplierModel model = new SupplierModel { SUPLNO = "1", SUPLNAME = "Supplier1", SUPLADDR = "SuppAddress1" }; mockSupplierRepository.Setup(s => s.UpdateSupplier(It.IsAny <SupplierModel>())).Returns(Task.FromResult(model.SUPLNO).Result); var result = controller.PutSUPPLIER(model.SUPLNO, model) as NegotiatedContentResult <SupplierModel>; Assert.AreEqual(model.SUPLNO, result.Content.SUPLNO); }
public void UpdateDepartmentTest() { // Arrange var controller = new SUPPLIERsController(); SUPPLIER Sup = new SUPPLIER { SUPLNO = "1", SUPLADDR = "Mumbai", SUPLNAME = "KK ERP" }; // Act IHttpActionResult actionResult = controller.PutSUPPLIER(Sup.SUPLNO, Sup); var contentResult = actionResult as NegotiatedContentResult <SUPPLIER>; Assert.IsNull(contentResult); Assert.AreEqual(HttpStatusCode.Accepted, contentResult.StatusCode); Assert.IsNotNull(contentResult.Content); }