Пример #1
0
 public void StartTest()
 {
     context = Tools.GetEmptyContext(TestUser.User1);
     Tools.InitializeInMemoryMembershipStorage(@"G1:G2,G3,G4,G5,G6|G2:U1,U2|G3:U10,G7,G8,G9,G10,G11|G4:U3,U4,U5|G5:G12,G13,G14,G15|
         G6:U6|G7:|G8:U7,U8,U9|G9:G16,G17,G18,G19|G10:U11|G11:U12,U13|G12:U14,U15,U16,U17,U18,U19,U20|G13:U21|G14:U22,U23|
         G15:U24|G16:U25|G17:U26|G18:U27,U28|G19:U29|G20:U30,U31,U32,U33,G21,G22,G23|G21:U34,U35|G22:U36|G23:U37,U38");
     context.Security.Cache.Reset(context.Security.DataProvider);
     Assert.AreEqual(InitialMembership, MembershipTests.DumpMembership(context.Security));
 }
Пример #2
0
        public void Structure_MemParentChildren_Initial()
        {
            context = Tools.GetEmptyContext(TestUser.User1);
            var ctx  = context.Security;
            var repo = Tools.CreateRepository(ctx);

            var expected = "{E1{E2{E5{E14{E50{E51{E52}E53}}E15}E6{E16E17}E7{E18E19}}E3{E8{E20E21{E22E23E24E25E26E27E28E29}}E9E10}E4{E11E12{E30{E31{E33E34{E40E43{E44E45E46E47E48E49}}}E32{E35{E41{E42}}E36{E37{E38E39}}}}}E13}}}";
            var actual   = Tools.EntityIdStructureToString(ctx);

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void Structure_ResolveMissingEntity()
        {
            context = Tools.GetEmptyContext(TestUser.User1);
            var ctx        = new MissingEntityResolverContext(TestUser.User1);
            var contextAcc = new PrivateObject(context);

            contextAcc.SetFieldOrProperty("Security", ctx);

            //----

            try
            {
                var entity = context.Security.GetSecurityEntity(17, false);
                Assert.IsNull(entity);
                entity = context.Security.GetSecurityEntity(42, false);
                Assert.IsNotNull(entity);
                Assert.AreEqual(17, entity.OwnerId);
            }
            finally
            {
                ctx.Cache.Entities.Clear();
            }
        }
Пример #4
0
 public void StartTest()
 {
     __context = Tools.GetEmptyContext(TestUser.User1);
     CreatePlayground();
 }