Ejemplo n.º 1
0
        public void TestRun( )
        {
            var wf = new Workflow
            {
                Name = "Wf"
            };

            wf.AddDefaultExitPoint( );

            var l1 = new LogActivity
            {
                Name = "l1"
            }.Cast <WfActivity>( );
            var l2 = new LogActivity
            {
                Name = "12"
            }.Cast <WfActivity>( );

            // wf.FirstActivity = l1;
            //wf.ContainedActivities.Add(l1);
            wf.ContainedActivities.Add(l2);

            ActivityTestHelper.AddFirstActivityWithMapping(wf, l1, null);
            ActivityTestHelper.AddExpressionToActivityArgument(wf, l1, "Message", "'Message 1'", false);

            ActivityTestHelper.AddTransition(wf, l1, l2);
            ActivityTestHelper.AddExpressionToActivityArgument(wf, l2, "Message", "'Message 2'", false);

            ActivityTestHelper.AddTermination(wf, l2, l2.GetDefaultExitPoint(), CreateDefaultExitPoint());

            wf.Save( );
            ActivityImplementationBase nextActivity = wf.Cast <WfActivity>( ).CreateWindowsActivity( );

            l1.Save( );
            l2.Save( );

            ToDelete.Add(wf.Id);
            ToDelete.Add(l1.Id);
            ToDelete.Add(l2.Id);

            var run = (RunWorkflow(wf));

            Assert.AreEqual(WorkflowRunState_Enumeration.WorkflowRunCompleted, run.WorkflowRunStatus_Enum, "Finished without errors");

            // run using service
        }