示例#1
0
        public void CreateWellsNegativeTestApi()
        {
            var testcontroller = new WellsControllerMock();


            var result = testcontroller.Create(null);

            Assert.IsType <BadRequestResult>(result);
        }
示例#2
0
        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"]);
        }