public bool GetVehicleCheckOut(ref Vehicle vehicle, out string errorMessage) { errorMessage = string.Empty; vehicle = GetVehicle(vehicle.Id); if (IsActiveVehicle(vehicle.Id)) { vehicle.Payment = CalculatePayment(vehicle); vehicle.DepartureTime = dateTimeHelper.GetDateTimeNow(); vehicle.State = VehicleHelper.SetActive(); bool vehicleRegisteredSuccess = vehicleQuery.CheckOutVehicle(vehicle); return(vehicleRegisteredSuccess); } this.errorMessage = Messages.ErrorVehicleAlreadyCheckOut; errorMessage = this.errorMessage; return(false); }
private void InitializerMockCheckOutVehicle(Vehicle vehicleToReturn, bool willCheckOut) { dateTimeHelper.GetDateTimeNow().Returns(fakeDate); vehicleQuery.GetVehicle(Arg.Any <int>()).Returns(vehicleToReturn); vehicleQuery.CheckOutVehicle(Arg.Any <Vehicle>()).Returns(willCheckOut); }