Пример #1
0
        public override string WriteResultsToFile(Jargon jargon)
        {
            if (results == null)
            {
                return(string.Empty);
            }

            string ret = GetResultsFilePath();

            if (string.IsNullOrEmpty(ret))
            {
                return(string.Empty);
            }

            OutputWriter formatter;

            switch (jargon)
            {
            case Jargon.NUnitV2:
                formatter = new NUnit2XmlOutputWriter(DateTime.UtcNow);
                break;

            case Jargon.NUnitV3:
                formatter = new NUnit3XmlOutputWriter(DateTime.UtcNow);
                break;

            default:
                throw new InvalidOperationException($"Jargon {jargon} is not supported by this runner.");
            }

            formatter.WriteResultFile(results, ret);

            return(ret);
        }
Пример #2
0
        public override void WriteResultsToFile(TextWriter writer)
        {
            if (results == null)
            {
                return;
            }
            var resultsXml = new NUnit2XmlOutputWriter(DateTime.UtcNow);

            resultsXml.WriteResultFile(results, writer);
        }
Пример #3
0
        public override string WriteResultsToFile()
        {
            if (results == null)
            {
                return(string.Empty);
            }

            string ret = GetResultsFilePath();

            if (string.IsNullOrEmpty(ret))
            {
                return(string.Empty);
            }


            var resultsXml = new NUnit2XmlOutputWriter(DateTime.UtcNow);

            resultsXml.WriteResultFile(results, ret);

            return(ret);
        }
Пример #4
0
        public override void WriteResultsToFile(TextWriter writer, Jargon jargon)
        {
            if (results == null)
            {
                return;
            }
            OutputWriter formatter;

            switch (jargon)
            {
            case Jargon.NUnitV2:
                formatter = new NUnit2XmlOutputWriter(DateTime.UtcNow);
                break;

            case Jargon.NUnitV3:
                formatter = new NUnit3XmlOutputWriter(DateTime.UtcNow);
                break;

            default:
                throw new InvalidOperationException($"Jargon {jargon} is not supported by this runner.");
            }
            formatter.WriteResultFile(results, writer);
        }