Example #1
0
        public void DeleteHomeConfig()
        {
            repo.Delete(entity);
            repo.Save();

            Assert.IsNull(ctx.HomeConfigSet.FirstOrDefault(p => p.Home.Id == entity.Id));
            Assert.IsNotNull(ctx.HomeSet.FirstOrDefault(p => p.Id == entity.Id));

            repo.Delete(repo.GetHomeConfigById((int)ctx.HomeSet.FirstOrDefault(p => p.Title == "LaCorderie").Id, (int)ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie").ClientId));
            repo.Save();

            Assert.IsNull(ctx.HomeConfigSet.FirstOrDefault(p => p.Home == ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie")));
            Assert.IsNotNull(ctx.HomeSet.FirstOrDefault(p => p.Title == "LaCorderie"));
        }
Example #2
0
 public void Init()
 {
     ctx  = EFContext.CreateContext();
     repo = new HomeConfigRepository(ctx);
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         entity = new HomeConfig()
         {
             Home = new Home()
             {
                 Title             = "LaCorderieTest",
                 EstablishmentType = EEstablishmentType.BB,
                 Client            = manager.FindByEmail("*****@*****.**"),
             },
             AutoSendSatisfactionEmail = false,
             DepositNotifEnabled       = false,
             Devise                  = "$",
             EnableDinner            = false,
             EnableDisplayActivities = false,
             EnableDisplayMeals      = false,
             EnableDisplayProducts   = false,
             EnableDisplayRooms      = false,
             EnableReferencing       = false,
             FollowStockEnable       = false,
             HourFormat24            = true
         };
     }
     repo.Add(entity);
     repo.Save();
 }
 public void Init()
 {
     ctx = EFContext.CreateContext();
     repo = new HomeConfigRepository(ctx);
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         entity = new HomeConfig()
         {
             Home = new Home()
             {
                 Title = "LaCorderieTest",
                 EstablishmentType = EEstablishmentType.BB,
                 Client = manager.FindByEmail("*****@*****.**"),
             },
             AutoSendSatisfactionEmail = false,
             DepositNotifEnabled = false,
             Devise = "$",
             EnableDinner = false,
             EnableDisplayActivities = false,
             EnableDisplayMeals = false,
             EnableDisplayProducts = false,
             EnableDisplayRooms = false,
             EnableReferencing = false,
             FollowStockEnable = false,
             HourFormat24 = true
         };
     }
     repo.Add(entity);
     repo.Save();
 }