public void ForbiddenResource()
 {
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetDepositById(1, manager.FindByEmail("*****@*****.**").Id));
         Assert.IsNull(repo.GetDepositByBookingId(1, 8590, (int)ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie").ClientId));
         Assert.IsNull(repo.GetDepositByBookingId(1, 1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Beispiel #2
0
 public void ForbiddenResource()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetDepositById(1, manager.FindByEmail("*****@*****.**").Id));
         Assert.IsNull(repo.GetDepositByBookingId(1, 8590, (int)ctx.HomeSet.FirstOrDefault(x => x.Title == "LaCorderie").ClientId));
         Assert.IsNull(repo.GetDepositByBookingId(1, 1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Beispiel #3
0
 public void GetRoomCategoryWithBadHomeId()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetRoomCategoryById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Beispiel #4
0
        public void DeleteSatisfactionConfig()
        {
            Home home;

            using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                ctx.HomeSet.Add(home = new Home()
                {
                    Title             = "LaCorderieTest",
                    EstablishmentType = EEstablishmentType.BB,
                    Client            = manager.FindByEmail("*****@*****.**"),
                });
            }

            SatisfactionConfig toAdd;

            repo.Add(toAdd = new SatisfactionConfig()
            {
                Home  = home,
                Title = "ttt"
            });

            repo.Save();

            repo.Delete(toAdd);
            repo.Save();

            Assert.IsNull(ctx.SatisfactionConfigSet.FirstOrDefault(p => p.Home.Id == home.Id));
            Assert.IsNull(ctx.SatisfactionConfigQuestionSet.Include("SatisfactionConfig").FirstOrDefault(p => p.SatisfactionConfig.Id == toAdd.Id));
            Assert.IsNotNull(ctx.HomeSet.FirstOrDefault(p => p.Title == home.Title));
        }
Beispiel #5
0
 public void GetPeopleWithBadHomeId()
 {
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetPeopleById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Beispiel #6
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();
 }
        public void DeleteSatisfactionConfig()
        {
            Home home;

            using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                ctx.HomeSet.Add(home = new Home()
                {
                    Title = "LaCorderieTest",
                    EstablishmentType = EEstablishmentType.BB,
                    Client = manager.FindByEmail("*****@*****.**"),
                });
            }

            SatisfactionConfig toAdd;

            repo.Add(toAdd = new SatisfactionConfig()
            {
                Home = home,
                Title = "ttt"
            });

            repo.Save();

            repo.Delete(toAdd);
            repo.Save();

            Assert.IsNull(ctx.SatisfactionConfigSet.FirstOrDefault(p => p.Home.Id == home.Id));
            Assert.IsNull(ctx.SatisfactionConfigQuestionSet.Include("SatisfactionConfig").FirstOrDefault(p => p.SatisfactionConfig.Id == toAdd.Id));
            Assert.IsNotNull(ctx.HomeSet.FirstOrDefault(p => p.Title == home.Title));
        }
 public void ForbiddenResource()
 {
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetRoomSupplementById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Beispiel #10
0
 public void ForbiddenResource()
 {
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetRoomById(ctx.RoomSet.FirstOrDefault(x => x.Title == "Melanie").Id, (int)manager.FindByEmail("*****@*****.**").DefaultHomeId));
     }
 }
Beispiel #11
0
 public void ForbiddenResource()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetFieldGroupById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Beispiel #12
0
 public void GetForbiddenResource()
 {
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Tax get = repo.GetTaxById(1, manager.FindByEmail("*****@*****.**").Id);
         Assert.IsNull(get);
     }
 }
Beispiel #13
0
 public void GetForbiddenResource()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Tax get = repo.GetTaxById(1, manager.FindByEmail("*****@*****.**").Id);
         Assert.IsNull(get);
     }
 }
        public void ShouldFailBecauseOfNotPermitted()
        {
            using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                RoomCategory get = repo.GetRoomCategoryById(ctx.RoomCategorySet.FirstOrDefault(p => p.Title == "Cat1").Id, (int)manager.FindByEmail("*****@*****.**").DefaultHomeId);

                Assert.IsNull(get);
            }
        }
Beispiel #15
0
 public void ShouldNotGetBecauseOfNotPermitted()
 {
     //Bed get = repo.GetBedById(ctx.BedSet.FirstOrDefault(p => p.NumberPeople == 2).Id, (int)ctx.ClientSet.FirstOrDefault(p => p.Email == "*****@*****.**").DefaultHomeId);
     using (ClientUserManager manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Bed get = repo.GetBedById(ctx.BedSet.FirstOrDefault(p => p.NumberPeople == 2).Id, (int)manager.FindByEmail("*****@*****.**").DefaultHomeId);
         Assert.IsNull(get);
     }
 }
Beispiel #16
0
        public void ForbiddenResource()
        {
            repo.Add(b);
            repo.Save();

            using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                Assert.IsNull(repo.GetBookingById(b.Id, manager.FindByEmail("*****@*****.**").Id));
            }
        }
Beispiel #17
0
        public void GetBedWithBadHomeId()
        {
            repo.Add(entity);
            repo.Save();

            using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                Assert.IsNull(repo.GetBedById(entity.Id, manager.FindByEmail("*****@*****.**").Id));
            }
        }
Beispiel #18
0
        public void ForbiddenResource()
        {
            repo.Add(b);
            repo.Save();

            using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                Assert.IsNull(repo.GetBookingById(b.Id, manager.FindByEmail("*****@*****.**").Id));
            }
        }
Beispiel #19
0
        public void ForbiddenResource()
        {
            repo.Add(entity);
            repo.Save();

            using (ClientUserManager manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                Assert.IsNull(repo.GetAdditionalBookingById(entity.Id, manager.FindByEmail("*****@*****.**").Id));
            }
        }
Beispiel #20
0
        public void GetBedWithBadHomeId()
        {
            repo.Add(entity);
            repo.Save();

            using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                Assert.IsNull(repo.GetBedById(entity.Id, manager.FindByEmail("*****@*****.**").Id));
            }
        }
Beispiel #21
0
 public void ForbiddenResource()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetRoomById(ctx.RoomSet.FirstOrDefault(x => x.Title == "Melanie").Id, (int)manager.FindByEmail("*****@*****.**").DefaultHomeId));
     }
 }
Beispiel #22
0
        public void ShouldFailBecauseOfNotPermitted()
        {
            using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                RoomCategory get = repo.GetRoomCategoryById(ctx.RoomCategorySet.FirstOrDefault(p => p.Title == "Cat1").Id, (int)manager.FindByEmail("*****@*****.**").DefaultHomeId);

                Assert.IsNull(get);
            }
        }
        public void ForbiddenResource()
        {
            repo.Add(entity);
            repo.Save();

            using (ClientUserManager manager = new ClientUserManager(new CustomUserStore(ctx)))
            {
                Assert.IsNull(repo.GetAdditionalBookingById(entity.Id, manager.FindByEmail("*****@*****.**").Id));
            }
        }
Beispiel #24
0
 public void ShouldNotGetBecauseOfNotPermitted()
 {
     //Bed get = repo.GetBedById(ctx.BedSet.FirstOrDefault(p => p.NumberPeople == 2).Id, (int)ctx.ClientSet.FirstOrDefault(p => p.Email == "*****@*****.**").DefaultHomeId);
     using (ClientUserManager manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Bed get = repo.GetBedById(ctx.BedSet.FirstOrDefault(p => p.NumberPeople == 2).Id, (int)manager.FindByEmail("*****@*****.**").DefaultHomeId);
         Assert.IsNull(get);
     }
 }