public void TestGetAllBookingStagesNull() { List <BookingStage> bookingStagesToReturn = new List <BookingStage>(); bookingStagesToReturn.ForEach(r => _context.Add(r)); _context.SaveChanges(); var repository = new BookingStageRepository(_context); var result = repository.GetAll(); Assert.IsTrue(result.Count() == 0); }
public void TestGetAllBookingStagesOk() { List <BookingStage> bookingStagesToReturn = new List <BookingStage>() { new BookingStage() { Id = 1, Description = "The booking was added correctly, awaiting payment", Administrator = new Administrator() { Email = "*****@*****.**" }, AdministratorId = 0, AsociatedBooking = new Booking(), AsociatedBookingId = 0, EntryDate = DateTime.Now, Status = new Status(), }, new BookingStage() { Id = 2, Description = "The booking was rejected due to payment issues, please contact your bank", Administrator = new Administrator() { Email = "*****@*****.**" }, AdministratorId = 0, AsociatedBooking = new Booking(), AsociatedBookingId = 0, EntryDate = DateTime.Now, Status = new Status(), }, }; bookingStagesToReturn.ForEach(r => _context.Add(r)); _context.SaveChanges(); var repository = new BookingStageRepository(_context); var result = repository.GetAll(); Assert.IsTrue(bookingStagesToReturn.SequenceEqual(result)); }