예제 #1
0
        public void UpdateVehicles_WithReturnOkResult()
        {
            //Arrange
            var mockIMapper = new Mock <IMapper>();

            var mockIVehicleService = new Mock <IVehicleService>();

            mockIVehicleService.Setup(p => p.Update(vehicle));
            VehiclesController vehiclesController = new VehiclesController(mockIVehicleService.Object, mockIMapper.Object);

            //Act
            var sutResult = vehiclesController.UpdateVehicles(vehicle);
            var okResult  = sutResult as OkResult;

            //Assert
            Assert.IsNotNull(okResult);
            Assert.AreEqual(200, okResult.StatusCode);
        }