Ejemplo n.º 1
0
        public void ExpenseProcessSerializationTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.LoadProcessDescriptorFromFile("Expense.xml");

            IWfProcess process = WfProcessTestCommon.StartupProcess(processDesp);

            process.ApplicationRuntimeParameters["Amount"] = 500;

            WfRuntime.PersistWorkflows();

            process = WfRuntime.GetProcessByProcessID(process.ID);

            WfProcessTestCommon.MoveToNextDefaultActivityWithExecutor(process);

            process = WfRuntime.GetProcessByProcessID(process.ID);

            IWfActivityDescriptor currentActDesp = process.CurrentActivity.Descriptor;

            ToTransitionsDescriptorCollection transitions = currentActDesp.ToTransitions;

            foreach (string key in transitions.GetAllKeys())
            {
                Assert.IsTrue(key.IsNotEmpty());

                IWfTransitionDescriptor transition = transitions[key];

                Assert.AreEqual(key, transition.Key);
            }
        }