예제 #1
0
        public void Test_LogicalExecution_Values()
        {
            ApplicationContext.Clear();

            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Client, ApplicationContext.LogicalExecutionLocation, "Default value of 'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Client'");

            var dataPortal = new Server.DataPortal();

            dataPortal.Create(typeof(LogicalExecutionTestBusiness), null, new DataPortalContext(null, false), true).Wait();
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Server, (ApplicationContext.LogicalExecutionLocations)ApplicationContext.GlobalContext["LogicalExecutionDataPortalTests_Create"], "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Server' DURING 'Create'");
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Client, ApplicationContext.LogicalExecutionLocation, "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Client' AFTER 'Create'");
            ApplicationContext.Clear();

            dataPortal.Fetch(typeof(LogicalExecutionTestBusiness), null, new DataPortalContext(null, false), true).Wait();
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Server, (ApplicationContext.LogicalExecutionLocations)ApplicationContext.GlobalContext["LogicalExecutionDataPortalTests_Fetch"], "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Server' DURING 'Fetch'");
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Client, ApplicationContext.LogicalExecutionLocation, "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Client' AFTER 'Fetch'");
            ApplicationContext.Clear();

            dataPortal.Delete(typeof(LogicalExecutionTestBusiness), null, new DataPortalContext(null, false), true).Wait();
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Server, (ApplicationContext.LogicalExecutionLocations)ApplicationContext.GlobalContext["LogicalExecutionDataPortalTests_Delete"], "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Server' DURING 'Delete'");
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Client, ApplicationContext.LogicalExecutionLocation, "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Client' AFTER 'Delete'");
            ApplicationContext.Clear();

            dataPortal.Update(new LogicalExecutionTestBusiness(), new DataPortalContext(null, false), true).Wait();
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Server, (ApplicationContext.LogicalExecutionLocations)ApplicationContext.GlobalContext["LogicalExecutionDataPortalTests_Update"], "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Server' DURING 'Update'");
            Assert.AreEqual(ApplicationContext.LogicalExecutionLocations.Client, ApplicationContext.LogicalExecutionLocation, "'ApplicationContext.LogicalExecutionLocation' must be 'LogicalExecutionLocations.Client' AFTER 'Update'");
        }
예제 #2
0
 public virtual DataPortalResult Delete(object criteria, DataPortalContext context)
 {
     Server.DataPortal portal = new Server.DataPortal();
     return(portal.Delete(criteria, context));
 }