Exemplo n.º 1
0
        private async Task Run(Guid envId, ITestCaseQuery query, Guid id)
        {
            var env = await _appEnvRepository.FirstOrDefaultAsync(x => x.Id == envId);

            var testCases = await query.Query(id);

            await _executor.Execute(env.Host, testCases);
        }
        private void AddToTree(ITestCaseQuery query, TreeNode workingNode)
        {
            string working = query.Name.Replace("«", string.Empty).Trim();
            string queryName;
            string[] path = null;
            string[] parts = working.Split('»');
            if (parts.Length == 2)
            {
                path = parts[0].Split('⁄');
                queryName = parts[1];
            }
            else
            {
                queryName = parts[0];
            }

            if (path != null)
            {
                foreach (string part in path)
                {
                    TreeNode newNode = new TreeNode { Text = part, Name = part };
                    TreeNode[] foundNode = workingNode.Nodes.Find(newNode.Name, false);

                    if (foundNode.Length == 0)
                    {
                        workingNode.Nodes.Add(newNode);
                        workingNode = workingNode.Nodes[workingNode.Nodes.Count - 1];
                    }
                    else
                    {
                        workingNode = foundNode[0];
                    }
                }
            }

            workingNode.Nodes.Add(new TreeNode { Text = string.Format("Query: {0}", queryName), Name = queryName, Tag = query });
        }
 private void AddToTeamQueries(ITestCaseQuery query)
 {
     AddToTree(query, _queryTreeView.Nodes[1]);
 }
 private void PopulateTreeView(ITestCaseQuery query)
 {
     if (string.IsNullOrEmpty(query.Owner))
     {
         AddToMyQueries(query);
     }
     else
     {
         AddToTeamQueries(query);
     }
 }