public void FirstChildNextSibling_2_SmallTree_2_ToStringReturnsProperResult() { // Arrange IFirstChildNextSibling <string> tree = DSBuilder.CreateFirstChildNextSibling_Small(); string expected = "a,FC(b,FC(d),NS(c))"; // Act string actual = tree.ToString(); Assert.AreEqual(expected, actual); }
public void FirstChildNextSibling_2_SmallTree_1_SizeReturnsProperResult() { // Arrange IFirstChildNextSibling <string> tree = DSBuilder.CreateFirstChildNextSibling_Small(); int expected = 4; // Act int actual = tree.Size(); Assert.AreEqual(expected, actual); }
static void Opgave2() { System.Console.WriteLine("\n===== Opgave 2 : FirstChildNextSibling =====\n"); IFirstChildNextSibling <string> tree; // Empty tree tree = DSBuilder.CreateFirstChildNextSibling_Empty(); tree.PrintPreOrder(); System.Console.WriteLine("Size: {0}", tree.Size()); System.Console.WriteLine(tree); // Small tree tree = DSBuilder.CreateFirstChildNextSibling_Small(); tree.PrintPreOrder(); System.Console.WriteLine("Size: {0}", tree.Size()); System.Console.WriteLine(tree); // Tree from figure 18.3 tree = DSBuilder.CreateFirstChildNextSibling_18_3(); tree.PrintPreOrder(); System.Console.WriteLine("Size: {0}", tree.Size()); System.Console.WriteLine(tree); }