Exemplo n.º 1
0
		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());
		}
Exemplo n.º 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);
		}
Exemplo n.º 3
0
		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);
		}
Exemplo n.º 4
0
		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());
		}
Exemplo n.º 5
0
		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());
		}
Exemplo n.º 6
0
		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);
		}
Exemplo n.º 7
0
		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());
		}