示例#1
0
 public async Task ScenarioOkay01Test()
 {
     // arrange
     //| ---Date 1--- |
     //               | ---Date 2--- |
     Reservation = new Reservation
     {
         CarId = 1,
         From  = new DateTime(Year, 01, 20),
         To    = new DateTime(Year, 01, 30)
     };
     // act & assert
     Assert.True(await _target.AvailabilityCheck(Reservation));
 }
示例#2
0
        public override async Task <CheckResponse> AvailabilityCheck(ReservationDto request, ServerCallContext context)
        {
            Reservation   reservation = request.ConvertToEntity();
            CheckResponse response    = new CheckResponse();

            response.IsValid = await _reservationManager.AvailabilityCheck(reservation);

            return(response);
        }
示例#3
0
        public override async Task <IsAvailableResponse> CheckAvailability(ReservationDto request, ServerCallContext context)
        {
            var reservation = request.ConvertToEntity();

            try
            {
                await reservationenManager.AvailabilityCheck(reservation);
            } catch (AutoUnavailableException)
            {
                return(new IsAvailableResponse {
                    IsAvailable = false
                });
            }
            return(new IsAvailableResponse {
                IsAvailable = true
            });
        }