public void ResourcesShouldExist() { BookingStepConfig toDelete = ctx.BookingStepConfigSet.FirstOrDefault(p => p.Title == "Room Steps"); Assert.AreEqual(ctx.BookingStepBookingSet.Include("BookingStepConfig").Where(p => p.BookingStepConfig.Id == toDelete.Id).ToList().Count, 1); Assert.AreEqual(ctx.BookingStepSet.Include("BookingStepConfig").Where(p => p.BookingStepConfig.Id == toDelete.Id).ToList().Count, 3); Assert.AreNotEqual(ctx.BookingSet.ToList().Count, 0); }
public void Init() { ctx = EFContext.CreateContext(); repo = new BookingStepConfigRepository(ctx); entity = new BookingStepConfig() { HomeId = ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie").Id, Title = "EFtest" }; }
public void DeleteBookingStepConfig() { BookingStepConfig toDelete = ctx.BookingStepConfigSet.FirstOrDefault(p => p.Title == "Room Steps"); Assert.IsNotNull(toDelete); repo.Delete(toDelete); repo.Save(); Assert.AreEqual(ctx.BookingStepBookingSet.Include("BookingStepConfig").Where(p => p.BookingStepConfig.Id == toDelete.Id).ToList().Count, 0); Assert.AreEqual(ctx.BookingStepSet.Include("BookingStepConfig").Where(p => p.BookingStepConfig.Id == toDelete.Id).ToList().Count, 0); Assert.AreNotEqual(ctx.BookingSet.ToList().Count, 0); }
public void Init() { ctx = EFContext.CreateContext(); repo = new BookingStepBookingRepository(ctx); BookingStepConfig tmpconfig = new BookingStepConfig() { Home = ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie"), Title = "EFTest" }; entity = new BookingStepBooking() { Booking = new Booking() { Comment = "I am a comment", DateArrival = DateTime.Now.AddYears(4), DateCreation = DateTime.Now, DateDeparture = DateTime.Now.AddYears(8), DateDesiredPayment = DateTime.Now.AddYears(1).AddMonths(10), DateModification = DateTime.Now, DateValidation = DateTime.Now.AddMonths(18), Home = ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie"), IsOnline = false, IsSatisfactionSended = false, People = new People() { AcceptMailing = true, Addr = "4 place kleber", City = "Strasbourg", Civility = "Mr", Comment = "A mis le feu à la chambre", Country = "FRANCE", DateBirth = DateTime.Now, DateCreation = DateTime.Now, Email = "*****@*****.**", Firstname = "CHAABANE", Home = ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie"), Lastname = "Jalal", Mark = 0, Phone1 = "0600000000", Phone2 = null, State = null, ZipCode = "67000", Hide = false, }, TotalPeople = 4 }, BookingStepConfig = tmpconfig, CurrentStep = new BookingStep() { Home = ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie"), BookingStepConfig = tmpconfig, Title = "EFTest", BookingValidated = true, BookingArchived = false }, Home = ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie"), DateCurrentStepChanged = DateTime.Now, MailSent = 0, Canceled = false }; }