public void TestManageRejectWorkFlow()
        {
            var appEntity = new AppInfoModel
            {
                ActivityState = "Submit",
                AppId         = "004",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "004",
                CurrentState  = "Common"
            };
            var result = WfServiceInstance.NewWorkFlow(appEntity);

            Assert.AreEqual(result, "Manage");

            var manageEntity = new AppInfoModel
            {
                ActivityState = "Reject",
                AppId         = "004",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "005",
                CurrentState  = "Manage"
            };
            var manageResult = WfServiceInstance.Execute(manageEntity);

            Assert.AreEqual(manageResult, "Refuse");
        }
        public void TestRevokeWorkflow()
        {
            var appEntity = new AppInfoModel
            {
                ActivityState = "Submit",
                AppId         = "007",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "007",
                CurrentState  = "Common"
            };
            var result = WfServiceInstance.NewWorkFlow(appEntity);

            Assert.AreEqual(result, "Manage");

            var commonEntity = new AppInfoModel
            {
                ActivityState = "Revoke",
                AppId         = "007",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "007",
                CurrentState  = "Common"
            };
            var revokeResult = WfServiceInstance.Execute(commonEntity);

            Assert.AreEqual(revokeResult, "Common");
        }
        public void TestSaveWorkflow()
        {
            var appEntity = new AppInfoModel
            {
                ActivityState = "Save",
                AppId         = "006",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "006",
                CurrentState  = "Common"
            };
            var result = WfServiceInstance.NewWorkFlow(appEntity);

            Assert.AreEqual(result, "Common");
        }
        public void TestWorkflowAppState()
        {
            var appEntity = new AppInfoModel
            {
                ActivityState = "Submit",
                AppId         = "009",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "009",
                CurrentState  = "Common"
            };

            var firstState = WfServiceInstance.GetApplicationStateByAppId(appEntity.AppId);

            Assert.AreEqual(firstState, ApplicationState.Draft);
            var result = WfServiceInstance.NewWorkFlow(appEntity);

            Assert.AreEqual(result, "Manage");
            var secondState = WfServiceInstance.GetApplicationStateByAppId(appEntity.AppId);

            Assert.AreEqual(secondState, ApplicationState.InProgress);
            var commonEntity = new AppInfoModel
            {
                ActivityState = "Approve",
                AppId         = "009",
                AppName       = "TestApp",
                WorkflowName  = "TestStateWorkFlow",
                UserId        = "009",
                CurrentState  = "Manage"
            };
            var approveResult = WfServiceInstance.Execute(commonEntity);

            Assert.AreEqual(approveResult, "Done");
            var thirdState = WfServiceInstance.GetApplicationStateByAppId(appEntity.AppId);

            Assert.AreEqual(thirdState, ApplicationState.Complete);
        }