예제 #1
0
        public ConnectionModule(IUserStore userStore, IConnectionValidator connectionValidator, IEncryptionProvider encryptionProvider, IWorkflowInfoService workflowStoreService, IWorkflowStoreFactory workflowStoreFactory)
            : base()
        {
            _userStore            = userStore;
            _connectionValidator  = connectionValidator;
            _encryptionProvider   = encryptionProvider;
            _workflowStoreService = workflowStoreService;
            _workflowStoreFactory = workflowStoreFactory;

            // lists all connections for the current user
            Get[Actions.Connection.List] = (x) =>
            {
                //this.RequiresAnyClaim(Claims.AllClaims);
                return(this.List());
            };
            // deletes a connection for the current user
            Post[Actions.Connection.Delete] = (x) =>
            {
                this.RequiresClaims(Claims.ConnectionDelete);
                return(DeleteConnection());
            };
            // saves a connection for the current user
            Post[Actions.Connection.Save] = (x) =>
            {
                this.RequiresClaims(Claims.ConnectionAdd);
                return(Save());
            };
            // tests a new connection for the current user
            Post[Actions.Connection.Test] = (x) =>
            {
                //this.RequiresAnyClaim(Claims.ConnectionAdd);
                return(Test());
            };
        }
        public void ConnectionModuleTest_SetUp()
        {
            _userStore            = Substitute.For <IUserStore>();
            _encryptionProvider   = Substitute.For <IEncryptionProvider>();
            _connectionValidator  = Substitute.For <IConnectionValidator>();
            _workflowStoreService = Substitute.For <IWorkflowInfoService>();
            _workflowStoreFactory = Substitute.For <IWorkflowStoreFactory>();

            Mapper.Initialize((cfg) =>
            {
                cfg.CreateMap <ConnectionModel, WorkflowStoreModel>();
            });
        }
예제 #3
0
        public void ConnectionModuleTest_SetUp()
        {
            _userStore            = Substitute.For <IUserStore>();
            _encryptionProvider   = Substitute.For <IEncryptionProvider>();
            _connectionValidator  = Substitute.For <IConnectionValidator>();
            _workflowStoreService = Substitute.For <IWorkflowInfoService>();
            _workflowStoreFactory = Substitute.For <IWorkflowStoreFactory>();

            var config = new MapperConfiguration(cfg => {
                cfg.CreateMap <ConnectionViewModel, ConnectionModel>();
                cfg.CreateMap <ConnectionModel, ConnectionViewModel>();
            });

            _mapper = config.CreateMapper();
        }
예제 #4
0
 public WorkflowEngineFactory(
     IActivityFactory activityFactory,
     IEventHandlerFactory eventHandlerFactory,
     IWorkflowDomainStore workflowDomainStore,
     IWorkflowStoreFactory workflowStoreFactory,
     IWorkflowMessageTransportFactoryProvider workflowMessageTransportFactoryProvider,
     IWorkflowRuntimeConfigurationFactory workflowRuntimeConfigurationFactory)
 {
     _activityFactory      = activityFactory;
     _eventHandlerFactory  = eventHandlerFactory;
     _workflowDomainStore  = workflowDomainStore;
     _workflowStoreFactory = workflowStoreFactory;
     _workflowRuntimeConfigurationFactory     = workflowRuntimeConfigurationFactory;
     _workflowMessageTransportFactoryProvider = workflowMessageTransportFactoryProvider;
 }
예제 #5
0
        public StoreModule(IUserStore userStore, IWorkflowInfoService workflowInfoService, IWorkflowStoreFactory workflowStoreFactory) : base()
        {
            _userStore            = userStore;
            _workflowInfoService  = workflowInfoService;
            _workflowStoreFactory = workflowStoreFactory;

            // default action - used to display a single connection
            Get[Actions.Store.Default] = (x) =>
            {
                AddScript(Scripts.StoreView);
                return(Default());
            };
            // displays a list of workflows for a specified store
            Post[Actions.Store.List] = (x) =>
            {
                return(List());
            };
            // deletes a collection of workflows in a single database
            Post[Actions.Store.Remove] = (x) =>
            {
                return(Remove());
            };
            // suspends a collection of workflows in a single database
            Post[Actions.Store.Suspend] = (x) =>
            {
                return(Suspend());
            };
            // unsuspends a collection of workflows in a single database
            Post[Actions.Store.Unsuspend] = (x) =>
            {
                return(Unsuspend());
            };
            // loads a single workflow
            Post[Actions.Store.Workflow] = (x) =>
            {
                return(Workflow());
            };
        }
예제 #6
0
 public void UserModuleTest_SetUp()
 {
     _userStore            = Substitute.For <IUserStore>();
     _workflowInfoService  = Substitute.For <IWorkflowInfoService>();
     _workflowStoreFactory = Substitute.For <IWorkflowStoreFactory>();
 }
예제 #7
0
 public WorkflowInfoService(IWorkflowStoreFactory workflowStoreFactory)
 {
     _workflowStoreFactory = workflowStoreFactory;
 }
        public void WorkflowStoreInfoServiceTest_SetUp()
        {
            _workflowStoreFactory = Substitute.For <IWorkflowStoreFactory>();

            _workflowInfoService = new WorkflowInfoService(_workflowStoreFactory);
        }