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()); }
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); }
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); }
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()); }
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()); }
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); }
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()); }