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