コード例 #1
0
        /// <summary>
        /// Called when a test has finished
        /// </summary>
        /// <param name="result">The result of the test</param>
        public void TestFinished(ITestResult result)
        {
#if !SILVERLIGHT && !NETCF
            if (_teamCity != null)
            {
                _teamCity.TestFinished(result);
            }
#endif

            bool isSuite = result.Test.IsSuite;
            var  labels  = _options.DisplayTestLabels != null
                ? _options.DisplayTestLabels.ToUpper(CultureInfo.InvariantCulture)
                : "ON";

            if (!isSuite && labels == "ALL")
            {
                WriteTestLabel(result);
            }

            if (result.Output.Length > 0)
            {
                if (!isSuite && labels == "ON")
                {
                    WriteTestLabel(result);
                }
                _outWriter.Write(ColorStyle.Output, result.Output);
                if (!result.Output.EndsWith("\n"))
                {
                    _outWriter.WriteLine();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Called when a test has finished
        /// </summary>
        /// <param name="result">The result of the test</param>
        public void TestFinished(ITestResult result)
        {
#if !SILVERLIGHT
            if (_teamCity != null)
            {
                _teamCity.TestFinished(result);
            }
#endif

            bool isSuite = result.Test.IsSuite;
            var  labels  = _options.DisplayTestLabels != null
                ? _options.DisplayTestLabels.ToUpperInvariant()
                : "ON";

            if (!isSuite && labels == "ALL")
            {
                WriteTestLabel(result);
            }

            if (result.Output.Length > 0)
            {
                if (!isSuite && labels == "ON")
                {
                    WriteTestLabel(result);
                }
                _outWriter.Write(result.Output);
            }
        }
コード例 #3
0
ファイル: TextRunner.cs プロジェクト: rfregosa/nunit
        /// <summary>
        /// Called when a test has finished
        /// </summary>
        /// <param name="result">The result of the test</param>
        public void TestFinished(ITestResult result)
        {
#if !SILVERLIGHT
#if !NETCF
            if (_teamCity != null)
            {
                _teamCity.TestFinished(result);
            }
#endif

            _textUI.TestFinished(result);
#else
            // For Silverlight, we can't display the results
            // until the run is completed. We don't save anything
            // unless there is associated output, since that's
            // the only time we display anything in Silverlight.
            if (result.Output.Length > 0)
            {
                _results.Add(result);
            }
#endif
        }