public void TestBypassReadWriteWithRightsBackingField() { TestDIContext testDIContext = TestDIContextFactory.CreateContext(GetPrincipal("Admin")); IDataPortal <BypassBusinessBase> dataPortal = testDIContext.CreateDataPortal <BypassBusinessBase>(); UnitTestContext context = GetContext(); bool propertyChangedFired = false; BypassBusinessBase testObj = dataPortal.Fetch(); testObj.PropertyChanged += (o, e) => { propertyChangedFired = true; }; testObj.LoadId3(1); context.Assert.AreEqual(true, testObj.IsDirty); context.Assert.AreEqual(1, testObj.ReadId3()); context.Assert.AreEqual(true, propertyChangedFired); context.Assert.Success(); context.Complete(); }
public void TestBypassReadWriteWithRightsBackingField() { UnitTestContext context = GetContext(); Csla.Test.Security.TestPrincipal.SimulateLogin(); bool propertyChangedFired = false; BypassBusinessBase testObj = new BypassBusinessBase(); testObj.PropertyChanged += (o, e) => { propertyChangedFired = true; }; testObj.LoadId3(1); context.Assert.AreEqual(true, testObj.IsDirty); context.Assert.AreEqual(1, testObj.ReadId3()); context.Assert.AreEqual(true, propertyChangedFired); context.Assert.Success(); Csla.Test.Security.TestPrincipal.SimulateLogout(); context.Complete(); }
public void TestBypassReadWriteWithRightsBackingField() { UnitTestContext context = GetContext(); Csla.ApplicationContext.User = GetPrincipal("Admin"); bool propertyChangedFired = false; BypassBusinessBase testObj = new BypassBusinessBase(); testObj.PropertyChanged += (o, e) => { propertyChangedFired = true; }; testObj.LoadId3(1); context.Assert.AreEqual(true, testObj.IsDirty); context.Assert.AreEqual(1, testObj.ReadId3()); context.Assert.AreEqual(true, propertyChangedFired); context.Assert.Success(); Csla.ApplicationContext.User = new ClaimsPrincipal(); context.Complete(); }
public void TestBypassReadWriteWithRightsBackingField() { 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 bool propertyChangedFired = false; BypassBusinessBase testObj = new BypassBusinessBase(); testObj.PropertyChanged += (o, e) => { propertyChangedFired = true; }; testObj.LoadId3(1); context.Assert.AreEqual(true, testObj.IsDirty); context.Assert.AreEqual(1, testObj.ReadId3()); context.Assert.AreEqual(true, propertyChangedFired); 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(); }