コード例 #1
0
ファイル: JesterUtilities.cs プロジェクト: Milstein/Jester-3
        //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
ファイル: TesterForm.cs プロジェクト: Milstein/Jester-3
        private string SelectTest(MethodInfo method)
        {
            MethodTestInfo testInfo = methodDictionary[method.Name];

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