Example #1
0
        /// <summary>
        /// This command will shutdown the client socket
        /// </summary>
        /// <param name="cmdData"></param>
        /// <param name="message"></param>
        /// <param name="elements"></param>
        /// <returns></returns>
        public Result Execute(ExternalCommandData cmdData, ref string message, ElementSet elements)
        {
            RTFClientStartCmd.ShutdownClient();

            return(Result.Succeeded);
        }
 public void OnErrorOutLine(string text)
 {
     RTFClientStartCmd.SendConsoleMessage(text, Framework.ConsoleMessageType.ErrorOut);
 }
        private testcaseType RunTest(TestMethod t, MethodInfo[] setupMethods = null)
        {
            //Send information about the test case to be run to the server
            RTFClientStartCmd.SendTestInformation(t.TestName.Name, fixtureName);

            TestFilter filter = new NameFilter(t.TestName);

            var result = t.Run(new TestListener(), filter);

            //result types
            //Ignored, Failure, NotRunnable, Error, Success
            var testCase = new testcaseType
            {
                name     = t.TestName.Name,
                executed = result.Executed.ToString(),
                success  = result.IsSuccess.ToString(),
                asserts  = result.AssertCount.ToString(CultureInfo.InvariantCulture),
                time     = result.Time.ToString(CultureInfo.InvariantCulture)
            };

            switch (result.ResultState)
            {
            case ResultState.Cancelled:
                testCase.result = "Cancelled";
                break;

            case ResultState.Error:
                var f = new failureType {
                    message = result.Message, stacktrace = result.StackTrace
                };
                testCase.Item   = f;
                testCase.result = "Error";
                break;

            case ResultState.Failure:
                var fail = new failureType {
                    message = result.Message, stacktrace = result.StackTrace
                };
                testCase.Item   = fail;
                testCase.result = "Failure";
                break;

            case ResultState.Ignored:
                testCase.result = "Ignored";
                break;

            case ResultState.Inconclusive:
                testCase.result = "Inconclusive";
                break;

            case ResultState.NotRunnable:
                testCase.result = "NotRunnable";
                break;

            case ResultState.Skipped:
                testCase.result = "Skipped";
                break;

            case ResultState.Success:
                testCase.result = "Success";
                break;
            }

            return(testCase);
        }
 public void OnConsoleOutLine(string text)
 {
     RTFClientStartCmd.SendConsoleMessage(text);
 }