Example #1
0
        public async Task <int> CalculateParkingRate(CalculateParkingRate request)
        {
            var parkingLot = await _repository.Load(request.ParkingLotId);

            ParkingCharge rate = new ParkingCharge(parkingLot.DailyRate, parkingLot.HourlyRate);

            return(rate.CalculateCharge(request.StartDateTime, request.EndDateTime));
        }
Example #2
0
        public void ThenTheResultShouldBe(int expected)
        {
            var actual = parkingCharge.CalculateCharge(StartTime, EndTime);

            Assert.AreEqual(expected, actual);
        }