private void DeleteAppointment_OnClick(object sender, RoutedEventArgs e)
        {
            var selectedRow = this.AllAppointments.SelectedItem as AppointmentRowDto;

            if (selectedRow == null)
            {
                return;
            }

            var appointmentService = new AppointmentsService();

            appointmentService.DeleteAppointment(selectedRow.Id);

            this.GetCurrentAppointments();
        }
        public async Task DeleteAppointmentShouldDeleteAppointment(bool isTrainerDeleter)
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
            var db = new ApplicationDbContext(options);
            var appointmentsRepository = new EfDeletableEntityRepository <Appointment>(db);
            var usersRepository        = new EfDeletableEntityRepository <ApplicationUser>(db);
            var notificationsService   = new Mock <INotificationsService>();

            var service = new AppointmentsService(
                appointmentsRepository,
                usersRepository,
                notificationsService.Object);

            var client       = new ApplicationUser();
            var trainer      = new ApplicationUser();
            var role         = new ApplicationRole(GlobalConstants.TrainerRoleName);
            var identityRole = new IdentityUserRole <string>()
            {
                RoleId = role.Id,
                UserId = trainer.Id,
            };

            trainer.Roles.Add(identityRole);

            await usersRepository.AddAsync(trainer);

            await usersRepository.AddAsync(client);

            await usersRepository.SaveChangesAsync();

            var inputModel = new AddAppointmentInputModel()
            {
                StartTime  = DateTime.UtcNow,
                EndTime    = DateTime.UtcNow.AddDays(3),
                ClientId   = client.Id,
                TrainerId  = trainer.Id,
                IsApproved = true,
                Notes      = null,
                Type       = AppointmentType.Consultation,
            };

            var appointment = await service.AddAppoinmentAsync(inputModel);

            await service.DeleteAppointment(client.Id, trainer.Id, appointment.Id, isTrainerDeleter);

            Assert.True(appointment.IsDeleted);
        }