src/GenFx.Components.Tests/TreeNodeCollectionTest.cs
/// <summary>
/// Tests that the <see cref="TreeNodeCollection.GetEnumerator"/>. method works correctly.
/// </summary>
Tests that the . method works correctly.
Tests that the . method works correctly .
[Fact]
        public void TreeNodeCollection_GetEnumerator()
        {
            TreeNodeCollection collection = new TreeNodeCollection();
            TreeNode node1 = new TreeNode();
            collection.Add(node1);
            TreeNode node2 = new TreeNode();
            collection.Add(node2);
            int index = 0;
            foreach (TreeNode node in (IEnumerable)collection)
            {
                switch (index)
                {
                    case 0:
                        Assert.Same(node1, node);
                        break;
                    case 1:
                        Assert.Same(node2, node);
                        break;
                    default:
                        break;
                }
                index++;
            }
            Assert.Equal(2, index);
        }
[ Fact ] public void TreeNodeCollection_GetEnumerator ( ) { TreeNodeCollection collection = new TreeNodeCollection ( ) ; TreeNode node1 = new TreeNode ( ) ; collection . Add ( node1 ) ; TreeNode node2 = new TreeNode ( ) ; collection . Add ( node2 ) ; int index = 0 ; foreach ( TreeNode node in ( IEnumerable ) collection ) { switch ( index ) { case 0 : Assert . Same ( node1 , node ) ; break ; case 1 : Assert . Same ( node2 , node ) ; break ; default : break ; } index ++ ; } Assert . Equal ( 2 , index ) ; }
Tests that the .
Tests that the .