Exemplo n.º 1
0
        /// <summary>
        /// View a test cases list
        /// </summary>
        /// <param name="TeamProjectName"></param>
        /// <param name="TestPlanId"></param>
        /// <param name="testSuite"></param>
        private static void ViewTestCases(string TeamProjectName, int TestPlanId, TestSuite testSuite)
        {
            List <TestCase> testCases = TestPlanClient.GetTestCaseListAsync(TeamProjectName, TestPlanId, testSuite.Id).Result;

            if (testCases.Count > 0)
            {
                foreach (TestCase testCase in testCases)
                {
                    Console.WriteLine("Test: {0} - {1}", testCase.workItem.Id, testCase.workItem.Name);

                    var wiFields = GetWorkItemFields(testCase.workItem.WorkItemFields);

                    if (wiFields.ContainsKey("System.State"))
                    {
                        Console.WriteLine("Test Case State: {0}", wiFields["System.State"].ToString());
                    }

                    foreach (var config in testCase.PointAssignments)
                    {
                        Console.WriteLine("Run for: {0} : {1}", config.Tester.DisplayName, config.ConfigurationName);
                    }
                }
            }
        }