WriteLine() public static méthode

public static WriteLine ( string format ) : void
format string
Résultat void
Exemple #1
0
        public static void PrintOutResult(Result result)
        {
            CIResultOutput.WriteLine("##teamcity[testStarted name='{0}__{1}' captureStandardOutput='true']",
                                     CIResultOutput.Encode(result.Test.Name),
                                     CIResultOutput.Encode(result.Platform));

            CIResultOutput.DontWrite(result.Test.Fixture.Assembly.Name + ".");
            CIResultOutput.DontWrite(result.Test.Fixture.Name + ".");
            Console.Write(result.Test.Name);
            Console.WriteLine("[{0}]", result.Platform);
            Console.Write(result.Kind);
            Console.WriteLine(" ({0})", result.EndTime - result.StartTime);
            Console.WriteLine(result.Output);


            var match = ConventionMatch.ResultMatchesName(result);

            if (!match.HasValue)
            {
                Unknown.Add(result);

                CIResultOutput.WriteLine("##teamcity[testIgnored name='{0}__{1}' message='Result type not specified']",
                                         CIResultOutput.Encode(result.Test.Name),
                                         CIResultOutput.Encode(result.Platform));
                CIResultOutput.PostMatchResult(result, ResultKind.NoError);
                Console.WriteLine("???? Unknown Output ????");
            }
            else if (match.Value)
            {
                Correct.Add(result);
                CIResultOutput.PostMatchResult(result, ResultKind.Success);
                Console.WriteLine("++++ Correct Output ++++");
            }
            else
            {
                Invalid.Add(result);

                CIResultOutput.WriteLine(
                    "##teamcity[testFailed name='{0}_{1}' message='Does not match expected result' details='did not expect {2}']",
                    CIResultOutput.Encode(result.Test.Name), CIResultOutput.Encode(result.Platform), result.Kind);
                CIResultOutput.PostMatchResult(result, ResultKind.Fail);
                Console.WriteLine("!!!! Invalid Output !!!!");
            }
            CIResultOutput.DontWriteLine(String.Empty);
            CIResultOutput.DontWriteLine("*************************");

            CIResultOutput.WriteLine("##teamcity[testFinished name='{0}__{1}' duration='{2}']",
                                     CIResultOutput.Encode(result.Test.Name),
                                     CIResultOutput.Encode(result.Platform),
                                     (result.EndTime - result.StartTime).TotalMilliseconds);
        }
Exemple #2
0
 public void Dispose()
 {
     CIResultOutput.WriteLine("##teamcity[testSuiteFinished name='{0}']", Encode(_name));
 }