public void Parse_HierarchyPath_from_string_with_mixed_slashes_and_backslashes() { // ARRANGE TreesorNodePath result = TreesorNodePath.Parse(@"a\b/c"); // ASSERT Assert.AreEqual(HierarchyPath.Create("a", "b", "c"), result.HierarchyPath); }
public void Parse_HierarchyPath_from_string_with_slashes() { // ARRANGE TreesorNodePath result = TreesorNodePath.Parse("a/b"); // ASSERT Assert.AreEqual(HierarchyPath.Create("a", "b"), result.HierarchyPath); }
public void Create_TreesorNodePath_from_path_item_array() { // ACT TreesorNodePath result = TreesorNodePath.Create("a", "b"); // ASSERT Assert.AreEqual(HierarchyPath.Create("a", "b"), result.HierarchyPath); }
public void Create_TreesorNodePath_from_HierarchyPath() { // ARRANGE var treeKey = HierarchyPath.Create("a"); // ACT TreesorNodePath result = TreesorNodePath.Create(treeKey.Items.ToArray()); // ASSERT Assert.AreEqual(treeKey, result.HierarchyPath); Assert.AreNotSame(treeKey, result.HierarchyPath); }
public void TreesorNodePathes_are_not_equal_if_HierarchyPaths_are_not_equal() { // ARRANGE var left = TreesorNodePath.Create("b", "a"); var right = TreesorNodePath.Create("a", "b"); // ACT bool result1 = left.Equals(right); bool result2 = right.Equals(left); // ASSERT Assert.IsFalse(result1); Assert.IsFalse(result2); Assert.AreNotEqual(left.GetHashCode(), right.GetHashCode()); }