예제 #1
0
 public TravelRequestManagerApprovalStateConfigurator(IUserSecurityContext userSecurityContext)
 {
     if (userSecurityContext == null)
     {
         throw new ArgumentNullException(nameof(userSecurityContext));
     }
     _userSecurityContext = userSecurityContext;
 }
예제 #2
0
        protected override ITravelRequestWorkflow CreateTravelRequestWorkflow(IUserSecurityContext userSecurityContext = null, INotifier notifier = null)
        {
            userSecurityContext = userSecurityContext ?? new UserSecurityContext();
            notifier            = notifier ?? Substitute.For <INotifier>();
            var workflowConfigurator = new TravelRequestWorkflowGeneralConfigurator(userSecurityContext, notifier);
            var stateMachineFactory  = new StateMachineFactory(workflowConfigurator);

            return(new TravelRequestWorkflow_SimpleWithConfigurators(stateMachineFactory));
        }
예제 #3
0
 public TravelRequestTravelerReviewStateConfigurator(IUserSecurityContext userSecurityContext, INotifier notifier)
 {
     if (userSecurityContext == null)
     {
         throw new ArgumentNullException(nameof(userSecurityContext));
     }
     if (notifier == null)
     {
         throw new ArgumentNullException(nameof(notifier));
     }
     _userSecurityContext = userSecurityContext;
     _notifier            = notifier;
 }
 public TravelRequestWorkflow_Simple(IUserSecurityContext userSecurityContext, INotifier notifier)
 {
     if (userSecurityContext == null)
     {
         throw new ArgumentNullException(nameof(userSecurityContext));
     }
     if (notifier == null)
     {
         throw new ArgumentNullException(nameof(notifier));
     }
     _userSecurityContext = userSecurityContext;
     _notifier            = notifier;
 }
        protected override ITravelRequestWorkflow CreateTravelRequestWorkflow(IUserSecurityContext userSecurityContext = null, INotifier notifier = null)
        {
            userSecurityContext = userSecurityContext ?? new UserSecurityContext();
            notifier            = notifier ?? Substitute.For <INotifier>();
            var reusableTravelRequestStateMachineConfigurators = new List <IReusableTravelRequestStateMachineConfigurator>
            {
                new TravelRequestNewStateConfigurator(),
                new TravelRequestCapturedStateConfigurator(),
                new TravelRequestTravelerReviewStateConfigurator(userSecurityContext, notifier),
                new TravelRequestHRApprovalStateConfigurator(userSecurityContext),
                new TravelRequestManagerApprovalStateConfigurator(userSecurityContext),
                new TravelRequestProcurementApprovalStateConfigurator(userSecurityContext),
                new TravelRequestHODApprovalStateConfigurator(userSecurityContext),
                new TravelRequestBookTicketsStateConfigurator(),
            };
            var reusableTravelRequestStateMachine = new ReusableTravelRequestStateMachine(reusableTravelRequestStateMachineConfigurators);

            return(new TravelRequestWorkflow_ReusableWithConfigurators(reusableTravelRequestStateMachine));
        }
예제 #6
0
 protected override ITravelRequestWorkflow CreateTravelRequestWorkflow(IUserSecurityContext userSecurityContext = null, INotifier notifier = null)
 {
     userSecurityContext = userSecurityContext ?? new UserSecurityContext();
     notifier            = notifier ?? Substitute.For <INotifier>();
     return(new TravelRequestWorkflow_Simple(userSecurityContext, notifier));
 }
예제 #7
0
 protected abstract ITravelRequestWorkflow CreateTravelRequestWorkflow(IUserSecurityContext userSecurityContext = null, INotifier notifier = null);