Ejemplo n.º 1
0
        public async Task CheckGettingAppointmentsForTodayAsync()
        {
            ApplicationDbContext db = GetDb();

            var repository = new EfDeletableEntityRepository <Appointment>(db);
            var service    = new AppointmentsService(
                repository,
                this.usersService.Object,
                this.cardsService.Object,
                this.proceduresService.Object,
                this.categoriesService.Object);

            await this.PrepareAppointmentsAsync(service);

            var appointments = await service.GetAllAppointmentsForTodayAsync <TestAppointmentModel>();

            var appointmentsExpected = await repository
                                       .All()
                                       .Where(a => a.DateTime == DateTime.UtcNow.Date)
                                       .To <TestAppointmentModel>()
                                       .ToListAsync();

            Assert.Empty(appointments);
            appointments.SequenceEqual(appointmentsExpected);
        }