Exemplo n.º 1
0
 public void AddChild(TestNode testNode)
 {
     _children.Add(testNode);
     HasChildren = true;
 }
        private static async Task EnumerateTestCasesAsync(uint level, StorageFolder parentFolder, TestNode parentNode)
        {
            if (parentFolder == null || parentNode == null)
            {
                return;
            }

            // Process child folders...
            IReadOnlyList <StorageFolder> childFolders = await parentFolder.GetFoldersAsync();

            foreach (StorageFolder childFolder in childFolders)
            {
                // Create a new test node...
                TestNode childNode = new TestNode(parentNode, level + 1, childFolder.DisplayName, childFolder.Path);
                parentNode.AddChild(childNode);

                // Recurse...
                await EnumerateTestCasesAsync(level + 1, childFolder, childNode);
            }

            // Process child files...
            IReadOnlyList <StorageFile> childFiles = await parentFolder.GetFilesAsync();

            foreach (StorageFile childFile in childFiles)
            {
                TestNode childNode = new TestNode(parentNode, level + 1, childFile.Name, childFile.Path);
                parentNode.AddChild(childNode);
            }
        }