Пример #1
0
        public async Task GetAvailabilityAsync_HasBookings_NoCapacity()
        {
            // Make the call
            DefaultAvailabilityService service = new DefaultAvailabilityService(_context);
            var result = await service.GetAvailabilityAsync(
                DateTime.UtcNow.Date.AddDays(7),
                DateTime.UtcNow.Date.AddDays(7),
                7,
                CancellationToken.None);

            // Validate the result
            Assert.NotNull(result);
            Assert.Equal(0, Enumerable.Count <Availability>(result));
        }
Пример #2
0
        public async Task GetAvailabilityAsync_NoBookings_HasCapacity()
        {
            // Make the call
            DefaultAvailabilityService service = new DefaultAvailabilityService(_context);
            var result = await service.GetAvailabilityAsync(
                DateTime.UtcNow.Date.AddDays(6),
                DateTime.UtcNow.Date.AddDays(6),
                6,
                CancellationToken.None);

            // Validate the result
            Assert.NotNull(result);
            Assert.Equal(2, Enumerable.Count <Availability>(result));
            Assert.NotNull(result.First(availability => availability.FlightId == 1));
            Assert.NotNull(result.First(availability => availability.FlightId == 2));
        }