Exemplo n.º 1
0
        private async Task PrepareAppointmentsAndStatusAsync(AppointmentsService service)
        {
            string firstAppId = await service.CreateAsync(this.client.Id, this.stylist.Id, this.procedure.Id, DateTime.UtcNow, "11:00", "test comment");

            string secondAppId = await service.CreateAsync(this.client.Id, this.stylist.Id, this.procedure.Id, DateTime.UtcNow, "12:00", "test comment");

            string thirdAppId = await service.CreateAsync(this.client.Id, this.stylist.Id, this.procedure.Id, DateTime.UtcNow, "13:00", "test comment");

            await service.DoneAsync(firstAppId);

            await service.DoneAsync(secondAppId);

            await service.CancelAsync(thirdAppId);
        }
Exemplo n.º 2
0
        public async Task CheckCancelingAppointmentAsync()
        {
            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);

            string appointmentId = await this.GetAppointmentIdAsync(service);

            await service.CancelAsync(appointmentId);

            var appointment = await GetAppointmentAsync(repository, appointmentId);

            Assert.Equal(Status.Cancelled, appointment.Status);
        }