示例#1
0
        //calls a method.
        //if no exceptions were thrown then the test was a success.
        //if they were, then test failed
        //SelectTest stores the success values in the testInfo object
        public static string SelectTest(MethodInfo method, MethodTestInfo testInfo)
        {
            bool testPassed = true;

            try
            {
                JesterUtilities.RunTestMethod(method);
            }
            catch (TargetInvocationException ex)
            {
                testPassed = false;
                string errorInfo = JesterUtilities.GetErrorInfo(ex.InnerException);
                testInfo.ErrorInfo = errorInfo;
                testInfo.SetTestStatus(JestResultsEnum.FAILED);
                return(errorInfo);
            }

            if (testPassed)
            {
                string errorInfo = "Test Passed!";
                testInfo.ErrorInfo = errorInfo;
                testInfo.SetTestStatus(JestResultsEnum.PASSED);
                return(errorInfo);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        private string SelectTest(MethodInfo method)
        {
            MethodTestInfo testInfo = methodDictionary[method.Name];

            return(JesterUtilities.SelectTest(method, testInfo));
        }