public void CreateWellsNegativeTestApi() { var testcontroller = new WellsControllerMock(); var result = testcontroller.Create(null); Assert.IsType <BadRequestResult>(result); }
public void CreateWellsTestApi() { var testcontroller = new WellsControllerMock(); Wells well = new Wells() { Id = 2, FkFieldsId = 1 }; var result = testcontroller.Create(well); Assert.IsType <CreatedAtRouteResult>(result); Assert.Equal("getWellsFromField", ((CreatedAtRouteResult)result).RouteName); Assert.NotNull(((CreatedAtRouteResult)result).RouteValues["id"]); }