Exemplo n.º 1
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));
     }
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 3
0
 public void GetRoomCategoryWithBadHomeId()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetRoomCategoryById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Exemplo n.º 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));
        }
Exemplo n.º 5
0
 public void GetPeopleWithBadHomeId()
 {
     using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetPeopleById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Exemplo n.º 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();
 }
Exemplo n.º 7
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 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));
     }
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 11
0
 public void ForbiddenResource()
 {
     using (UserManager <Client, int> manager = new ClientUserManager(new CustomUserStore(ctx)))
     {
         Assert.IsNull(repo.GetFieldGroupById(1, manager.FindByEmail("*****@*****.**").Id));
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 14
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);
            }
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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));
     }
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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);
     }
 }