示例#1
0
        public async Task GetByUserAsync_ShouldReturnAllReservationsForUser(string clientId, int?reservationsPerPage, int skip)
        {
            MapperInitializer.InitializeMapper();
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();
            var reservationRepository = new EfDeletableEntityRepository <Reservation>(context);
            var reservationsService   = new ReservationsService(reservationRepository);
            var seeder = new DbContextTestsSeeder();
            await seeder.SeedReservationsAsync(context);

            var result = await reservationsService.GetByUserAsync(clientId, reservationsPerPage, skip);

            Assert.True(result.ToList().Count == 3, ErrorMessage);
        }