Пример #1
0
        public VSTestResult VSTest(IEnumerable <string> testAssemblyPaths)
        {
            using (var tempTrxFile = new TempFile())
            {
                ConfigureRun(toolResolver.VSTest)
                .AddRange(testAssemblyPaths)
                .Add("/logger:trx;LogFileName=" + tempTrxFile)
                .Run(throwOnError: false);

                return(VSTestResult.Load(tempTrxFile));
            }
        }
Пример #2
0
        public VSTestResult VSTest(IEnumerable <string> testAssemblyPaths)
        {
            using var tempTrxFile = new TempFile();

            var result = ConfigureRun(toolResolver.VSTest)
                         .AddRange(testAssemblyPaths)
                         .Add("/logger:trx;LogFileName=" + tempTrxFile)
                         .Run(throwOnError: false);

            if (new FileInfo(tempTrxFile).Length == 0)
            {
                result.ThrowIfError();
            }

            return(VSTestResult.Load(tempTrxFile));
        }
Пример #3
0
        public VSTestResult DotNetTest(bool noBuild = false)
        {
            using var tempTrxFile = new TempFile();

            var result = ConfigureRun("dotnet")
                         .Add("test")
                         .AddIf(noBuild, "--no-build")
                         .Add("--logger").Add("trx;LogFileName=" + tempTrxFile)
                         .Run(throwOnError: false);

            if (new FileInfo(tempTrxFile).Length == 0)
            {
                result.ThrowIfError();
            }

            return(VSTestResult.Load(tempTrxFile));
        }