Ejemplo n.º 1
0
        public async Task GetForUserOnPage_ShouldReturnReservationsForUserOnPage()
        {
            // 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 userReservations = await service.GetForUserOnPage <ReservationViewModel>(
                Users.User4NotEmployee.Id, 1, 2);

            // Assert
            Assert.AreEqual(2, userReservations.Count());
        }