Use object names instead of labels in node paths (#600)

This commit is contained in:
Matt Irvine
2018-04-06 14:36:47 -07:00
committed by Karl Burtram
parent 92456d50aa
commit 167948256c
4 changed files with 37 additions and 6 deletions

View File

@@ -184,21 +184,23 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
}
}
[Fact]
public void MultiLevelTreeShouldFormatPath()
{
TreeNode root = new TreeNode("root");
Assert.Equal("/root" , root.GetNodePath());
Assert.Equal("root" , root.GetNodePath());
TreeNode level1Child1 = new TreeNode("L1C1");
TreeNode level1Child1 = new TreeNode("L1C1 (with extra info)");
level1Child1.NodePathName = "L1C1";
TreeNode level1Child2 = new TreeNode("L1C2");
root.AddChild(level1Child1);
root.AddChild(level1Child2);
Assert.Equal("/root/L1C1" , level1Child1.GetNodePath());
Assert.Equal("/root/L1C2", level1Child2.GetNodePath());
Assert.Equal("root/L1C1" , level1Child1.GetNodePath());
Assert.Equal("root/L1C2", level1Child2.GetNodePath());
TreeNode level2Child1 = new TreeNode("L2C2");
level1Child1.AddChild(level2Child1);
Assert.Equal("/root/L1C1/L2C2", level2Child1.GetNodePath());
Assert.Equal("root/L1C1/L2C2", level2Child1.GetNodePath());
}
[Fact]