?? castletestcase.cs
字號:
using System.Collections;
using DotNetTools.Workflow.Spi;
using NUnit.Framework;
namespace DotNetTools.Workflow.Util
{
[TestFixture]
public class CastleTestCase : TestCaseBase
{
public CastleTestCase()
{
}
[Test]
public void Test()
{
CastleContainer context=new CastleContainer();
IWorkflow workflow=(IWorkflow)context["workflow"];
long workflowId = workflow.Initialize("castle", 1, null);
IList currentSteps = workflow.GetCurrentSteps(workflowId);
//校驗只有一個當前步驟
Assert.AreEqual( 1, currentSteps.Count,"Unexpected number of current steps");
//校驗這個步驟是1
IStep currentStep = (IStep)currentSteps[0];
Assert.AreEqual(1, currentStep.StepId,"Unexpected current step");
int[] availableActions = workflow.GetAvailableActions(workflowId);
//校驗只有一個可執行的動作
Assert.AreEqual( 1, availableActions.Length,"Unexpected number of available actions");
//校驗這個動作是2
Assert.AreEqual(2, availableActions[0],"Unexpected available action");
workflow.DoAction(workflowId, 2, null);
availableActions = workflow.GetAvailableActions(workflowId);
Assert.AreEqual(1,availableActions.Length);
Assert.AreEqual(3,availableActions[0]);
workflow.DoAction(workflowId,3,null);
availableActions = workflow.GetAvailableActions(workflowId);
Assert.AreEqual(0,availableActions.Length);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -