public void TestParameters() { RootEntry root = OutputParser.parse(@"a|color=#ff0"); Assert.AreEqual(1, root.children.Count); Assert.AreEqual("#ff0", root.children[0].color); }
public void TestSingleLine() { RootEntry root = OutputParser.parse("hello"); Assert.AreEqual(root.children.Count, 1); Assert.AreEqual(root.menu.Count, 0); Assert.AreEqual(root.children[0].text, "hello"); }
public void TestTwoLinesInRoot() { RootEntry root = OutputParser.parse(@"hello there"); Assert.AreEqual(root.children.Count, 2); Assert.AreEqual(root.menu.Count, 0); Assert.AreEqual(root.children[0].text, "hello"); Assert.AreEqual(root.children[1].text, "there"); }
public void TestOneContext() { RootEntry root = OutputParser.parse(@"hello --- there"); Assert.AreEqual(root.children.Count, 1); Assert.AreEqual(root.menu.Count, 1); Assert.AreEqual(root.children[0].text, "hello"); Assert.AreEqual(root.menu[0].text, "there"); }
public void TestNested() { RootEntry root = OutputParser.parse(@"a --- b --c ----d"); Assert.AreEqual(root.children.Count, 1); Assert.AreEqual(root.menu.Count, 1); Assert.AreEqual(root.menu[0].children.Count, 1); Assert.AreEqual(root.menu[0].children[0].children.Count, 1); }
public void TestFull() { RootEntry root = OutputParser.parse(@"a --- b --- c --d ----- --e --f"); Assert.AreEqual(root.children.Count, 1); Assert.AreEqual(3, root.menu.Count); }
public void TestSubmenuSeparator() { RootEntry root = OutputParser.parse(@"hello --- there --b ----- --c"); Assert.AreEqual(root.children.Count, 1); Assert.AreEqual(root.menu.Count, 1); Assert.AreEqual(root.children[0].text, "hello"); Assert.AreEqual(root.menu[0].text, "there"); Assert.AreEqual(root.menu[0].children[0].text, "b"); Assert.AreEqual(root.menu[0].children[1].isSeparator, true); }
public void TestNestedDifferentLevels() { RootEntry root = OutputParser.parse(@"a --- b --c ----d ----e ------f ------g --h ----l"); Assert.AreEqual(1, root.children.Count); Assert.AreEqual(1, root.menu.Count); Assert.AreEqual(2, root.menu[0].children.Count); Assert.AreEqual(2, root.menu[0].children[0].children.Count); Assert.AreEqual(2, root.menu[0].children[0].children[1].children.Count); Assert.AreEqual(1, root.menu[0].children[1].children.Count); }