Exemplo n.º 1
0
        public void TestInstantiate()
        {
            Assembly      asm = Assembly.GetExecutingAssembly();
            Stream        fs  = asm.GetManifestResourceStream("PerformanceTest.SimpleStateMachine.xml");
            IStateMachine sm  = new DefaultStateMachineFactory().CreateStateMachineFromXml(fs);

            _sm = sm as DefaultStateMachine;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize,instantiate xshellManager and stateMachine
        /// </summary>
        public void Initialize(IRemoteMethodInvoker remoteInvoker)
        {
            IStateMachine stateMachine = new DefaultStateMachineFactory().CreateStateMachineFromXml(stateMachineConfigXml);

            _stateMachine  = stateMachine as DefaultStateMachine;
            _xshellManager = XShellManager.GetInstance();
            _xshellManager.Initialize(remoteInvoker);
            _xshellManager._remoteInvoker.RegisterServiceObject <IWorkflow>(this);
        }
Exemplo n.º 3
0
        public void TestInstantiate()
        {
            Assembly      asm = Assembly.GetExecutingAssembly();
            Stream        fs  = asm.GetManifestResourceStream("UIH.XA.StateMachineUT.SimpleStateMachine.xml");
            IStateMachine sm  = new DefaultStateMachineFactory().CreateStateMachineFromXml(fs);

            _sm = sm as DefaultStateMachine;
            Assert.IsNotNull(_sm);
        }
Exemplo n.º 4
0
        public void TestToggleGateStateMachine()
        {
            Assembly      asm = Assembly.GetExecutingAssembly();
            Stream        fs  = asm.GetManifestResourceStream("UIH.XA.StateMachineUT.ToggleGateStateMachine.xml");
            IStateMachine sm  = new DefaultStateMachineFactory().CreateStateMachineFromXml(fs);

            Assert.IsNotNull(sm as DefaultStateMachine);
            Assert.AreEqual(sm.CurrentState.ID, "Initial");
            sm.Transit("start", null);
            Assert.AreEqual(sm.CurrentState.ID, "Close");
            sm.Transit("open", null);
            Assert.AreEqual(sm.CurrentState.ID, "Open");
            sm.Transit("close", null);
            Assert.AreEqual(sm.CurrentState.ID, "Close");
        }