Example #1
0
        public async Task CountAll_ShouldReturnTheCountOfAllReservations()
        {
            // Arange
            List <Reservation> reservationsData = new()
            {
                Reservations.Reservation1User3Room1NoClient,
                Reservations.Reservation2User4Room2NoClient,
                Reservations.Reservation3User4Room2NoClient
            };

            ApplicationDbContext context = await InMemoryFactory.InitializeContext()
                                           .SeedAsync(reservationsData);

            SettingService settingService = new(context);

            var service = new ReservationsService(context, settingService);

            // Act
            var allReservationsCount = await service.CountAllReservations();

            // Assert
            Assert.AreEqual(context.Reservations.Count(), allReservationsCount);
        }