示例#1
0
 public void Fetch()
 {
   BypassBusinessBaseUsingFactory returnValue = new BypassBusinessBaseUsingFactory();
   using (this.BypassPropertyChecks(returnValue))
   {
     returnValue.Id2 = 7; // bypass user rights
   }
 }
示例#2
0
        public void TestBypassFactory()
        {
            TestDIContext testDIContext = TestDIContextFactory.CreateContext(GetPrincipal("Admin"));
            IDataPortal <BypassBusinessBaseUsingFactory> dataPortal = testDIContext.CreateDataPortal <BypassBusinessBaseUsingFactory>();

            UnitTestContext context = GetContext();

            BypassBusinessBaseUsingFactory obj = BypassBusinessBaseUsingFactory.GetObject(dataPortal);

            context.Assert.AreEqual(false, obj.IsDirty);
            context.Assert.AreEqual(7, obj.ReadId2ByPass());
            context.Assert.Success();
            context.Complete();
        }
示例#3
0
        public void TestBypassFactory()
        {
            UnitTestContext context = GetContext();

            Csla.ApplicationContext.User = GetPrincipal("Admin");

            BypassBusinessBaseUsingFactory obj = BypassBusinessBaseUsingFactory.GetObject();

            context.Assert.AreEqual(false, obj.IsDirty);
            context.Assert.AreEqual(7, obj.ReadId2ByPass());
            context.Assert.Success();
            Csla.ApplicationContext.User = new ClaimsPrincipal();
            context.Complete();
        }
        public void TestBypassFactory()
        {
            UnitTestContext context = GetContext();

            Csla.Test.Security.TestPrincipal.SimulateLogin();

            BypassBusinessBaseUsingFactory obj = BypassBusinessBaseUsingFactory.GetObject();

            context.Assert.AreEqual(false, obj.IsDirty);
            context.Assert.AreEqual(7, obj.ReadId2ByPass());
            context.Assert.Success();
            Csla.Test.Security.TestPrincipal.SimulateLogout();
            context.Complete();
        }
        public void TestBypassFactory()
        {
            UnitTestContext context = GetContext();

            Csla.DataPortal.ProxyTypeName = "Local";
            Csla.Test.Security.TestPrincipal.SimulateLogin();

            BypassBusinessBaseUsingFactory.GetBypassBusinessBaseUsingFactory((o, e) =>
            {
                BypassBusinessBaseUsingFactory obj = e.Object;
                context.Assert.AreEqual(false, obj.IsDirty);
                context.Assert.AreEqual(7, obj.ReadId2ByPass());
                context.Assert.Success();
            });
            Csla.Test.Security.TestPrincipal.SimulateLogout();
            context.Complete();
        }
示例#6
0
        public void TestBypassFactory()
        {
            UnitTestContext context = GetContext();

#pragma warning disable CS0436 // Type conflicts with imported type
            Csla.Test.Security.TestPrincipal.SimulateLogin();
#pragma warning restore CS0436 // Type conflicts with imported type

            BypassBusinessBaseUsingFactory obj = BypassBusinessBaseUsingFactory.GetObject();
            context.Assert.AreEqual(false, obj.IsDirty);
            context.Assert.AreEqual(7, obj.ReadId2ByPass());
            context.Assert.Success();
#pragma warning disable CS0436 // Type conflicts with imported type
            Csla.Test.Security.TestPrincipal.SimulateLogout();
#pragma warning restore CS0436 // Type conflicts with imported type
            context.Complete();
        }