示例#1
0
        public async Task Run_Core_GeneratesTestReport(string template, string logger, string file, string project)
        {
            var testPath     = Path.GetFullPath(project);
            var resultsPath  = Path.Combine(testPath, "TestResults");
            var reportOutput = Path.Combine(resultsPath, file);

            await RunTestSamples.RunTest(testOutputHelper : _testOutputHelper,
                                         testProjectPath : testPath,
                                         logger : logger,
                                         templateName : template,
                                         logFilePrefix : reportOutput);

            var files = Directory.GetFiles(resultsPath, $"*{file}*");

            Assert.Contains(files, f => frameworks.Any(fw => f.Contains(fw)));
        }
示例#2
0
        public async Task Run_NUnit_GeneratesTestReport(string template, string logger, string file)
        {
            var testPath     = Path.GetFullPath("../../../../SampleProject/SampleProject.Tests.NUnit");
            var resultsPath  = Path.Combine(testPath, "TestResults");
            var reportOutput = Path.Combine(resultsPath, file);

            await RunTestSamples.RunTest(testOutputHelper : _testOutputHelper,
                                         testProjectPath : testPath,
                                         logger : logger,
                                         templateName : template,
                                         logFilePrefix : reportOutput);

            var files = Directory.GetFiles(resultsPath, $"{file}*");

            Assert.Contains(files, f => f.Contains("netcoreapp3.1"));
            Assert.Contains(files, f => f.Contains("net461"));
        }