コード例 #1
0
        public void AggregateActionTests()
        {
            //arrange
            var actionList = new List <IAction <string, Customer> >
            {
                new ActionOne(),
                new ActionTwo()
            };

            var sut = new AggregateAction <string, Customer>(actionList);

            var customer = new Customer {
                Id = 2, Name = "Test Customer"
            };

            var wf = new DefaultWorkflow <Customer>(Guid.NewGuid().ToString(),
                                                    Mock.SimpleWorkflowDefinition(),
                                                    customer);

            var graph = wf.ToDotGraph();

            graph.ShouldNotBeNullOrEmpty();
            output.WriteLine(graph);

            var trigger = wf.PermittedTriggers.First();
            var state   = wf.CurrentState;

            var transition = new WorkflowTransition <string, Customer>();

            sut.Execute(wf, transition);
        }
コード例 #2
0
        /// <summary>
        /// Install a New Agency
        /// </summary>
        /// <param name="implementation">The "State" Implementation relevant to the Agency.</param>
        /// <param name="name">Name of the Agency</param>
        /// <param name="ori">Federal Identifier for the Agency</param>
        /// <param name="classicRmsConnectionString">Connection string to the Classic RMS Database.</param>
        public static Guid Create(string implementation, string name, string ori, string classicRmsConnectionString)
        {
            Log.Info("Creating Agency: " + name + " - " + ori);
            Log.Info(Program.LineBreak);

            // Create a new Agency.
            var agencyId = CreateAgency(name, ori);

            // Create the Agency's Classic Integration Role
            ClassicIntegrationRole.Setup(agencyId);

            // Create the Default Workflow
            DefaultWorkflow.CreateInAgency(agencyId);

            // Install the TriTech Default Templates
            TriTechDefaultTemplates.Install(agencyId);

            // Install the Implementation Templates
            ImplementationTemplates.Install(agencyId, implementation);

            // Import Codes From Classic RMS
            SystemCodes.UpdateAgencyCodes(agencyId, classicRmsConnectionString);
            VehicleCodes.ImportIntoAgency(agencyId, classicRmsConnectionString);
            AgencyViolationCodes.ImportAgencyViolationCodes(agencyId, classicRmsConnectionString);
            AgencySystemConfigGlobal.UpdateAgencySettings(agencyId, classicRmsConnectionString);

            // Configuration
            AgencyDefaults.Apply(agencyId);

            return(agencyId);
        }
コード例 #3
0
        public MainWindowViewModel()
        {
            UiWorkflow = new DefaultWorkflow();
            UiWorkflow.InitSteps();
            SwitchDarkModeCommand = new DelegateCommand(SwitchDarkModeExecute, CanSwitchDarkModeExecute);
            InstallWebEnvCommand  = new DelegateCommand(InstallWebEnvExecute, CanInstallWebEnvExecute);

            IoC.RegisterInstance <IUiWorkflow>(UiWorkflow);
            ThemeManager.Current.ChangeTheme(App.Current, "Dark.Blue");
            EnableDarkMode = true;
            WebViewService = IoC.Resolve <WebViewService>();
        }
コード例 #4
0
        public void DefaultWorkflow_Success()
        {
            var idWf     = Guid.NewGuid().ToString();
            var customer = new Customer {
                Id = 2, Name = "Test Customer"
            };
            var wd = Mock.SimpleWorkflowDefinition();
            var wf = new DefaultWorkflow <Customer>(idWf, wd, customer);

            wf.Id.ShouldBe(idWf);

            var result = wf.Complete();

            result.ShouldBe(true);
        }