public IActionResult Put(int id)
        {
            Inicializer();
            Vehicle vehicle = new Vehicle();

            vehicle.Id = id;

            if (vehicleBusinessLogic.GetVehicleCheckOut(ref vehicle, out errorMessage))
            {
                return(Ok(JsonConvert.SerializeObject(vehicle, Formatting.Indented)));
            }
            else
            {
                response.BadRequest(errorMessage);
                return(BadRequest(JsonConvert.SerializeObject(response, Formatting.Indented)));
            }
        }
Example #2
0
        public void CalculatePaymentMotorcycle6Hours()
        {
            //Arrange
            Vehicle vehicle = VehicleDataObject.CreateMotorcycleActive(new DateTime(2018, 05, 15, 8, 0, 0));

            fakeDate = new DateTime(2018, 05, 15, 14, 0, 0);

            //Act
            InitializerMockCheckOutVehicle(vehicle, true);
            isRegisterSuccess = vehicleBusinessLogic.GetVehicleCheckOut(ref vehicle, out errorMessage);

            //Assert
            Assert.True(isRegisterSuccess);
            Assert.Equal(3000, vehicle.Payment);
            Assert.Empty(errorMessage);
        }