private static ICollection <BambooTest> retrieveTestsFromXPath(XPathNodeIterator it)
        {
            List <BambooTest> tests = new List <BambooTest>();

            while (it.MoveNext())
            {
                string className  = XPathUtils.getAttributeSafely(it.Current, "className", null);
                string methodName = XPathUtils.getAttributeSafely(it.Current, "methodName", null);
                string status     = XPathUtils.getAttributeSafely(it.Current, "status", null);
                if (className == null || methodName == null || status == null)
                {
                    continue;
                }
                BambooTest.TestResult res = BambooTest.TestResult.UNKNOWN;
                switch (status.ToLower())
                {
                case "successful":
                    res = BambooTest.TestResult.SUCCESSFUL;
                    break;

                case "failed":
                    res = BambooTest.TestResult.FAILED;
                    break;
                }
                BambooTest test = new BambooTest(className, methodName, res);
                tests.Add(test);
            }

            return(tests);
        }
Exemplo n.º 2
0
 public TestMethodNode(BambooTest test)
 {
     Name = test.MethodName;
     Icon = test.Result == BambooTest.TestResult.SUCCESSFUL
                ? Resources.icn_plan_passed
                : test.Result == BambooTest.TestResult.FAILED
                      ? Resources.icn_plan_failed
                      : Resources.icn_plan_disabled;
     Result = test.Result.GetStringValue();
     Test   = test;
 }
        private bool navigateToTestClassAndMethod(BambooTest test)
        {
            string fileName = null, lineNo = null;

            foreach (Project project in solution.Projects)
            {
                if (examineProjectItems(project.ProjectItems, test.ClassName, test.MethodName, ref fileName, ref lineNo))
                {
                    return(SolutionUtils.openSolutionFile(fileName, lineNo, solution));
                }
            }
            return(false);
        }
Exemplo n.º 4
0
 private static string[] splitTestClass(BambooTest test)
 {
     string[] strings = test.ClassName.Split(new[] { '.' });
     return(strings);
 }