public async void GetDogsitterAppointmentsToListShouldReturnProperValues() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); var appointmentsRepository = new EfDeletableEntityRepository <Appointment>(new ApplicationDbContext(options.Options)); var notificationsRepository = new EfDeletableEntityRepository <Notification>(new ApplicationDbContext(options.Options)); var appointmentsService = new AppointmentsService(notificationsRepository, appointmentsRepository); var dogsitter = new Dogsitter(); var owner = new Owner(); var user = new ApplicationUser { Dogsitter = dogsitter, UserName = "******", Email = "*****@*****.**", }; var user2 = new ApplicationUser { Owner = owner, UserName = "******", Email = "*****@*****.**", }; var appointment = new Appointment { Status = AppointmentStatus.Unprocessed, Date = DateTime.UtcNow, StartTime = DateTime.UtcNow, EndTime = DateTime.UtcNow.AddMinutes(5), Dogsitter = dogsitter, Owner = owner, }; dogsitter.Appointments.Add(appointment); dogsitter.UserId = user.Id; owner.Appointments.Add(appointment); owner.UserId = user2.Id; await appointmentsService.CreateNewAppointment(appointment); var appointments = appointmentsService.GetDogsitterAppointmentsToList(user.Id); var comparedAppointments = appointment.Id.CompareTo(appointments.First().Id); Assert.Equal(0, comparedAppointments); }