public WorkflowClient(IWorkflowStore workflowStore, IWorkflowRegistrationService workflowRegistrationService, ICommandFactory commandFactory)
        {
            _workflowStore = workflowStore;
            _workflowRegistrationService = workflowRegistrationService;

            this.CommandFactory = commandFactory;
        }
Exemplo n.º 2
0
        public void IsSingleInstanceWorkflowRegistered_OnExecute_UsesService()
        {
            // set up the store and the workflows
            IWorkflowStore workflowStore            = Substitute.For <IWorkflowStore>();
            IWorkflowRegistrationService regService = Substitute.For <IWorkflowRegistrationService>();

            IWorkflowServer workflowServer = new WorkflowServer(workflowStore, regService, Substitute.For <IWorkflowExceptionHandler>());

            workflowServer.IsSingleInstanceWorkflowRegistered <BasicWorkflow>();
            regService.Received(1).IsSingleInstanceWorkflowRegistered <BasicWorkflow>(workflowStore);
        }
        public void IsSingleInstanceWorkflowRegistered_OnExecute_UsesService()
        {
            // set up the store and the workflows
            IWorkflowStore workflowStore            = Substitute.For <IWorkflowStore>();
            IWorkflowRegistrationService regService = Substitute.For <IWorkflowRegistrationService>();

            IWorkflowClient workflowClient = new WorkflowClient(workflowStore, regService, Substitute.For <ICommandFactory>());

            workflowClient.IsSingleInstanceWorkflowRegistered <BasicWorkflow>();
            regService.Received(1).IsSingleInstanceWorkflowRegistered <BasicWorkflow>(workflowStore);
        }
Exemplo n.º 4
0
        public void RegisterWorkflow_OnRegister_UsesService()
        {
            // set up the store and the workflows
            IWorkflowStore workflowStore            = Substitute.For <IWorkflowStore>();
            IWorkflowRegistrationService regService = Substitute.For <IWorkflowRegistrationService>();

            BasicWorkflow   workflow       = new BasicWorkflow(BasicWorkflow.State.Start);
            IWorkflowServer workflowServer = new WorkflowServer(workflowStore, regService, Substitute.For <IWorkflowExceptionHandler>());

            workflowServer.RegisterWorkflow(workflow);

            regService.Received(1).RegisterWorkflow(workflowStore, workflow);
        }
        public void Register_OnRegister_UsesService()
        {
            // set up the store and the workflows
            IWorkflowStore workflowStore            = Substitute.For <IWorkflowStore>();
            IWorkflowRegistrationService regService = Substitute.For <IWorkflowRegistrationService>();

            BasicWorkflow   workflow       = new BasicWorkflow(BasicWorkflow.State.Start);
            IWorkflowClient workflowClient = new WorkflowClient(workflowStore, regService, Substitute.For <ICommandFactory>());

            workflowClient.Register(workflow);

            regService.Received(1).RegisterWorkflow(workflowStore, workflow);
        }
Exemplo n.º 6
0
 public WorkflowServer(IWorkflowStore workflowStore, IWorkflowRegistrationService workflowRegistrationService, IWorkflowExceptionHandler exceptionHandler)
 {
     _workflowStore = workflowStore;
     _workflowRegistrationService = workflowRegistrationService;
     _exceptionHandler            = exceptionHandler;
 }