예제 #1
0
        public override void SetUp()
        {
            base.SetUp();

            ctx = GetContext();
            var principalResolver = scope.Resolve<IPrincipalResolver>();

            var currentPrincipal = principalResolver.GetCurrent();

            Assert.That(currentPrincipal, Is.Not.Null, "No current identity found - try syncidentities or setup the current identity correctly");

            identity1 = ctx.Find<Identity>(currentPrincipal.ID);
            identity2 = ctx.GetQuery<Identity>().Where(i => i.ID != identity1.ID).First();

            parent = ctx.Create<SecurityTestParent>();
            parent.Name = "MyParent";

            child1 = ctx.Create<SecurityTestChild>();
            child1.Name = "Child1";
            child1.Identity = identity1;
            child1.Parent = parent;

            child2 = ctx.Create<SecurityTestChild>();
            child2.Name = "Child2";
            child2.Identity = identity2;
            child2.Parent = parent;

            ctx.SubmitChanges();
        }
예제 #2
0
        public override void SetUp()
        {
            base.SetUp();

            ctx = GetContext();
            var idResolver = scope.Resolve <IIdentityResolver>();

            var currentIdentity = idResolver.GetCurrent();

            Assert.That(currentIdentity, Is.Not.Null, "No current identity found - try syncidentities or setup the current identity correctly");

            identity1 = ctx.Find <Identity>(currentIdentity.ID);
            identity2 = ctx.GetQuery <Identity>().Where(i => i.ID != identity1.ID).First();

            parent      = ctx.Create <SecurityTestParent>();
            parent.Name = "MyParent";

            child1          = ctx.Create <SecurityTestChild>();
            child1.Name     = "Child1";
            child1.Identity = identity1;
            child1.Parent   = parent;

            child2          = ctx.Create <SecurityTestChild>();
            child2.Name     = "Child2";
            child2.Identity = identity2;
            child2.Parent   = parent;

            ctx.SubmitChanges();
        }
예제 #3
0
        protected virtual void Reload()
        {
            ctx       = GetContext();
            identity1 = ctx.Find <Identity>(identity1.ID);
            identity2 = ctx.Find <Identity>(identity2.ID);

            parent = ctx.Find <SecurityTestParent>(parent.ID);
            child1 = ctx.Find <SecurityTestChild>(child1.ID);
            child2 = ctx.Find <SecurityTestChild>(child2.ID);
        }
예제 #4
0
        protected virtual void Reload()
        {
            ctx = GetContext();
            identity1 = ctx.Find<Identity>(identity1.ID);
            identity2 = ctx.Find<Identity>(identity2.ID);

            parent = ctx.Find<SecurityTestParent>(parent.ID);
            child1 = ctx.Find<SecurityTestChild>(child1.ID);
            child2 = ctx.Find<SecurityTestChild>(child2.ID);
        }
예제 #5
0
 public static void ToString(SecurityTestChild obj, MethodReturnEventArgs<string> e)
 {
     e.Result = obj.Name;
 }
예제 #6
0
 public static void postSet_Parent(SecurityTestChild obj, PropertyPostSetterEventArgs<SecurityTestParent> e)
 {
     obj.Recalculate("ParentName");
 }
예제 #7
0
 public static void get_ParentName(SecurityTestChild obj, PropertyGetterEventArgs<string> e)
 {
     e.Result = obj.Parent != null ? obj.Parent.Name : string.Empty;
 }
예제 #8
0
 public static void get_ParentName(SecurityTestChild obj, PropertyGetterEventArgs <string> e)
 {
     e.Result = obj.Parent != null ? obj.Parent.Name : string.Empty;
 }
예제 #9
0
 public static void postSet_Parent(SecurityTestChild obj, PropertyPostSetterEventArgs <SecurityTestParent> e)
 {
     obj.Recalculate("ParentName");
 }
예제 #10
0
 public static void ToString(SecurityTestChild obj, MethodReturnEventArgs <string> e)
 {
     e.Result = obj.Name;
 }