private async Task <bool> ExpandDatabase(TestServiceDriverProvider testService, string sessionId, NodeInfo nodeInfo, TestTimer timer) { if (nodeInfo == null) { return(false); } bool foundNode = nodeInfo.NodePath.Contains("Database") || nodeInfo.NodeType == "Database"; var expandResult = await testService.CalculateRunTime(() => testService.RequestObjectExplorerExpand(new ObjectExplorer.Contracts.ExpandParams { SessionId = sessionId, NodePath = nodeInfo.NodePath }, 50000), foundNode?timer : null); Assert.NotNull(expandResult); Assert.NotNull(expandResult.Nodes); Assert.False(expandResult.Nodes == null, "Nodes are not valid"); if (!foundNode) { foreach (var node in expandResult.Nodes) { if (await ExpandDatabase(testService, sessionId, node, timer)) { return(true); } } return(false); } else { Console.WriteLine("Node Expanded " + nodeInfo.NodePath); return(true); } }