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