tznind 4 лет назад
Родитель
Сommit
5dad1d2221
1 измененных файлов с 15 добавлено и 0 удалено
  1. 15 0
      UnitTests/TreeViewTests.cs

+ 15 - 0
UnitTests/TreeViewTests.cs

@@ -305,6 +305,21 @@ namespace UnitTests {
 			Assert.Empty(tree.GetChildren(c2));
 		}
 
+		[Fact]
+		public void TreeNode_WorksWithoutDelegate()
+		{
+			var tree = new TreeView();
+
+			var root = new TreeNode("Root");
+			root.Children.Add(new TreeNode("Leaf1"));
+			root.Children.Add(new TreeNode("Leaf2"));
+
+			tree.AddObject(root);
+
+			tree.Expand(root);
+			Assert.Equal(2,tree.GetChildren(root).Count());
+		}
+
 
 		/// <summary>
 		/// Simulates behind the scenes changes to an object (which children it has) and how to sync that into the tree using <see cref="TreeView.RefreshObject(object, bool)"/>