Exemplo n.º 1
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();
        }
        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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 4
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();
        }