Database Execution Container
Inheritance: EsbExecutionContainer
 public void DatabaseServiceContainer_UnitTest_ExecuteWhereHasDatabaseServiceExecution_Guid()
 {
     //------------Setup for test--------------------------
     var mockServiceExecution = new Mock<IServiceExecution>();
     ErrorResultTO errors;
     Guid expected = Guid.NewGuid();
     mockServiceExecution.Setup(execution => execution.Execute(out errors, 0)).Returns(expected);
     DatabaseServiceContainer databaseServiceContainer = new DatabaseServiceContainer(mockServiceExecution.Object);
     //------------Execute Test---------------------------
     Guid actual = databaseServiceContainer.Execute(out errors, 0);
     //------------Assert Results-------------------------
     Assert.AreEqual(expected, actual, "Execute should return the Guid from the service execution");
 }
示例#2
0
        private EsbExecutionContainer GenerateContainer(ServiceAction serviceAction, IDSFDataObject dataObj, IWorkspace theWorkspace)
        {
            // set the ID for later use ;)
            dataObj.WorkspaceID = _workspace.ID;

            EsbExecutionContainer result = null;

            switch(serviceAction.ActionType)
            {
                case Common.Interfaces.Core.DynamicServices.enActionType.InvokeManagementDynamicService:
                    result = new InternalServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel, _request);
                    break;

                case Common.Interfaces.Core.DynamicServices.enActionType.InvokeStoredProc:
                    result = new DatabaseServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel);
                    break;
                case Common.Interfaces.Core.DynamicServices.enActionType.InvokeWebService:
                    result = new WebServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel);
                    break;

                case Common.Interfaces.Core.DynamicServices.enActionType.Plugin:
                    result = new PluginServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel);
                    break;

                case Common.Interfaces.Core.DynamicServices.enActionType.Workflow:
                    result = new WfExecutionContainer(serviceAction, dataObj, theWorkspace, _esbChannel);
                    break;

                case Common.Interfaces.Core.DynamicServices.enActionType.RemoteService:
                    result = new RemoteWorkflowExecutionContainer(serviceAction, dataObj, null, _esbChannel);
                    break;
            }

            return result;
        }