コード例 #1
0
ファイル: StateInfoTest.cs プロジェクト: ericziko/navigation
		public void A_B_CMakes3DialogsTest()
		{
			NavigationDiagram navigationConfiguration = LoadModel("Diagram/A_B_C.nav");
			List<Dialog> dialogs = new StateInfo().Convert(navigationConfiguration);
			Assert.IsTrue(ValidateNavigation(navigationConfiguration, dialogs));
			Assert.IsTrue(ValidateTransition(navigationConfiguration, dialogs));
			Assert.AreEqual(3, dialogs.Count());
		}
コード例 #2
0
		private void Validate(ValidationContext context)
		{
			StateInfo stateInfo = new StateInfo();
			List<Dialog> dialogs = stateInfo.Convert(this);
			ValidateDialogKey(context, dialogs);
			ValidateStateKey(context, dialogs);
			ValidateTransitionKey(context, dialogs);
			ValidatePathAndRoute(context, dialogs);
		}
コード例 #3
0
ファイル: StateInfoTest.cs プロジェクト: ericziko/navigation
		public void A1nbB_CnbBKeepsOnlyCRouteTest()
		{
			NavigationDiagram navigationConfiguration = LoadModel("Diagram/A1nbB_CnbB.nav");
			List<Dialog> dialogs = new StateInfo().Convert(navigationConfiguration);
			Assert.AreEqual(string.Empty, dialogs.First(d => d.Initial.Key == "A").States.First(s => s.Key == "B").Route);
			Assert.AreEqual("B", dialogs.First(d => d.Initial.Key == "C").States.First(s => s.Key == "B").Route);
		}
コード例 #4
0
ファイル: StateInfoTest.cs プロジェクト: ericziko/navigation
		public void BnCnBn1bA_DnA_EnAMakes4DialogsTest()
		{
			NavigationDiagram navigationConfiguration = LoadModel("Diagram/BnCnBn1bA_DnA_EnA.nav");
			List<Dialog> dialogs = new StateInfo().Convert(navigationConfiguration);
			Assert.IsTrue(ValidateNavigation(navigationConfiguration, dialogs));
			Assert.IsTrue(ValidateTransition(navigationConfiguration, dialogs));
			Assert.AreEqual(4, dialogs.Count());
		}
コード例 #5
0
ファイル: StateInfoTest.cs プロジェクト: ericziko/navigation
		public void AnBnCnAn1Cn1B_CiMakes1DialogTest()
		{
			NavigationDiagram navigationConfiguration = LoadModel("Diagram/AnBnCnAn1Cn1B_Ci.nav");
			List<Dialog> dialogs = new StateInfo().Convert(navigationConfiguration);
			Assert.IsTrue(ValidateNavigation(navigationConfiguration, dialogs));
			Assert.IsTrue(ValidateTransition(navigationConfiguration, dialogs));
			Assert.AreEqual(1, dialogs.Count());
		}
コード例 #6
0
ファイル: StateInfoTest.cs プロジェクト: ericziko/navigation
		public void AnbB_CnBnDnBMakesACBDDialogsTest()
		{
			NavigationDiagram navigationConfiguration = LoadModel("Diagram/AnbB_CnBnDnB.nav");
			List<Dialog> dialogs = new StateInfo().Convert(navigationConfiguration);
			Assert.IsTrue(ValidateNavigation(navigationConfiguration, dialogs));
			Assert.IsTrue(ValidateTransition(navigationConfiguration, dialogs));
			Assert.AreEqual("A", dialogs[0].Key);
			Assert.AreEqual("C", dialogs[1].Key);
			Assert.AreEqual("B", dialogs[2].Key);
			Assert.AreEqual("D", dialogs[3].Key);
		}
コード例 #7
0
ファイル: StateInfoTest.cs プロジェクト: ericziko/navigation
		public void AnB_CnBnDnBMakes3DialogsNotDTest()
		{
			NavigationDiagram navigationConfiguration = LoadModel("Diagram/AnB_CnBnDnB.nav");
			List<Dialog> dialogs = new StateInfo().Convert(navigationConfiguration);
			Assert.IsTrue(ValidateNavigation(navigationConfiguration, dialogs));
			Assert.IsTrue(ValidateTransition(navigationConfiguration, dialogs));
			Assert.AreEqual(3, dialogs.Count());
			Assert.IsNull(dialogs.Where(d => d.Initial.Key == "D").FirstOrDefault());
		}