コード例 #1
0
        public async void Task_Delete_ValidData_Return_OkResult()
        {
            //Arrange
            var Id = 2;

            //Act
            var result = await _controller.DeleteOrderDetail(Id);

            //Assert
            Assert.IsType <OkObjectResult>(result);
        }
コード例 #2
0
        public async Task DeleteOrderDetail_ReturnNoContent()
        {
            //Arrange
            int id = 1;

            _mockrepo.Setup(repo => repo.OrderDetail.DeleteOrderDetail((OrderDetail)null));
            //Act
            var result = await _controller.DeleteOrderDetail(id);

            //Assert
            var badRequest = Assert.IsType <NoContentResult>(result);
        }