Ejemplo n.º 1
0
        public void TestFinished(ITestResult result)
        {
            AndroidRunner.Results[result.Test.FullName ?? result.Test.Name] = result;

            if (result.Test is TestSuite)
            {
                if (!result.IsFailure() && !result.IsSuccess() && !result.IsInconclusive() && !result.IsIgnored())
                {
                    writer.WriteLine("\t[INFO] {0}", result.Message);
                }

                string name = result.Test.Name;
                if (!String.IsNullOrEmpty(name))
                {
                    writer.WriteLine("{0} : {1} ms", name, result.Duration.TotalMilliseconds);
                }
            }
            else
            {
                if (result.IsSuccess())
                {
                    writer.Write("\t[PASS] ");
                }
                else if (result.IsIgnored())
                {
                    writer.Write("\t[IGNORED] ");
                }
                else if (result.IsFailure())
                {
                    writer.Write("\t[FAIL] ");
                }
                else if (result.IsInconclusive())
                {
                    writer.Write("\t[INCONCLUSIVE] ");
                }
                else
                {
                    writer.Write("\t[INFO] ");
                }
                writer.Write(result.Test.Name);

                string message = result.Message;
                if (!String.IsNullOrEmpty(message))
                {
                    writer.Write(" : {0}", message.Replace("\r\n", "\\r\\n"));
                }
                writer.WriteLine();

                string stacktrace = result.StackTrace;
                if (!String.IsNullOrEmpty(result.StackTrace))
                {
                    string[] lines = stacktrace.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string line in lines)
                    {
                        writer.WriteLine("\t\t{0}", line);
                    }
                }
            }
        }
Ejemplo n.º 2
0
	    public void TestFinished(ITestResult result)
	    {
            AndroidRunner.Results[result.Test.FullName ?? result.Test.Name] = result;

            if (result.Test is TestSuite)
            {
                if (!result.IsFailure() && !result.IsSuccess() && !result.IsInconclusive() && !result.IsIgnored())
                    Writer.WriteLine("\t[INFO] {0}", result.Message);

                string name = result.Test.Name;
                if (!String.IsNullOrEmpty(name))
                    Writer.WriteLine("{0} : {1} ms", name, result.Time * 1000);
            }
            else
            {
                if (result.IsSuccess())
                {
                    Writer.Write("\t[PASS] ");
                }
                else if (result.IsIgnored())
                {
                    Writer.Write("\t[IGNORED] ");
                }
                else if (result.IsFailure())
                {
                    Writer.Write("\t[FAIL] ");
                }
                else if (result.IsInconclusive())
                {
                    Writer.Write("\t[INCONCLUSIVE] ");
                }
                else
                {
                    Writer.Write("\t[INFO] ");
                }
                Writer.Write(result.Test.Name);

                string message = result.Message;
                if (!String.IsNullOrEmpty(message))
                {
                    Writer.Write(" : {0}", message.Replace("\r\n", "\\r\\n"));
                }
                Writer.WriteLine();

                string stacktrace = result.StackTrace;
                if (!String.IsNullOrEmpty(result.StackTrace))
                {
                    string[] lines = stacktrace.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string line in lines)
                        Writer.WriteLine("\t\t{0}", line);
                }
            }
	    }