public void Test3(string tree) { // Arrange var at = new Algorithm.Tree.Problems.TreeCodec(',', '$'); // Act var treeNode = at.Deserialize(tree); var treeStr = at.Serialize2(treeNode); // Assert Assert.AreEqual(treeStr, tree); }
public void Test(List <int?> tree) { // Arrange var at = new Algorithm.Tree.Problems.TreeCodec(); // Act var treeNode = at.Deserialize(tree); var treeList = at.SerializeToList(treeNode); // Assert CollectionAssert.AreEqual(treeList, tree); }
public void Test(string tree, IList <IList <int> > expected) { // Arrange var at = new Algorithm.Tree.Problems.TreeCodec(',', '$'); var treeNode = at.Deserialize(tree); var prob = new Algorithm.Tree.Problems.VerticalOrderTraversal(); // Act var result = prob.VerticalOrder(treeNode); // Assert CollectionAssert.AreEquivalent(expected, result); }