Exemplo n.º 1
0
        public void Verify_Verify_AddBaselineAndNonBaselinePerformanceTestRunResults()
        {
            // Arrange
            var resultXmlFilePath   = EnsureFullPath("results.xml");
            var baselineXmlFilePath = EnsureFullPath("baseline.xml");
            var args = new[]
            {
                string.Format("--testresultsxmlsource={0}", resultXmlFilePath),
                string.Format("--baselinexmlsource={0}", baselineXmlFilePath)
            };

            optionsParser.ParseOptions(PerformanceBenchmark, args);

            // Act
            PerformanceBenchmark.AddBaselinePerformanceTestRunResults(testResultXmlParser, baselinePerformanceTestRunResults, baselineTestResults);
            PerformanceBenchmark.AddPerformanceTestRunResults(testResultXmlParser, performanceTestRunResults, testResults, new List <TestResult>());

            // Assert
            Assert.IsTrue(PerformanceBenchmark.ResultFilesExist);
            AssertCorrectResultXmlFilePaths(new[] { resultXmlFilePath });
            Assert.NotNull(testResults);
            Assert.IsTrue(testResults.Count > 0);
            Assert.NotNull(performanceTestRunResults);
            Assert.IsTrue(performanceTestRunResults.Count > 0);

            Assert.IsTrue(PerformanceBenchmark.BaselineResultFilesExist);
            AssertCorrectBaselineXmlFilePaths(new[] { baselineXmlFilePath });
            Assert.NotNull(baselineTestResults);
            Assert.IsTrue(baselineTestResults.Count > 0);
            Assert.NotNull(baselinePerformanceTestRunResults);
            Assert.IsTrue(baselinePerformanceTestRunResults.Count > 0);
        }
Exemplo n.º 2
0
        public void Verify_AddPerformanceTestRunResults_OneResultFiles_OneResultDirectory()
        {
            // Arrange
            var resultXmlFilePath = EnsureFullPath("results.xml");
            var resultsXmlDir     = EnsureFullPath("Results");
            var args = new[]
            {
                string.Format("--testresultsxmlsource={0}", resultXmlFilePath),
                string.Format("--testresultsxmlsource={0}", resultsXmlDir)
            };

            optionsParser.ParseOptions(PerformanceBenchmark, args);

            // Act
            PerformanceBenchmark.AddPerformanceTestRunResults(testResultXmlParser, performanceTestRunResults, testResults, new List <TestResult>());

            // Assert
            Assert.IsTrue(PerformanceBenchmark.ResultFilesExist);
            AssertCorrectResultsXmlDirectoryPaths(new[] { resultsXmlDir });
            AssertCorrectResultXmlFilePaths(new[] { resultXmlFilePath });
            Assert.NotNull(testResults);
            Assert.IsTrue(testResults.Count > 0);
            Assert.NotNull(performanceTestRunResults);
            Assert.IsTrue(performanceTestRunResults.Count > 0);
        }
Exemplo n.º 3
0
        public void VerifyV1_AddPerformanceTestRunResults_TwoResultFiles()
        {
            // Arrange
            var resultJsonFilePath = EnsureFullPath("results.json");
            var resultFileName2    = EnsureFullPath("results.json");
            var args = new[]
            {
                "--format=json",
                string.Format("--testresultsxmlsource={0}", resultJsonFilePath),
                string.Format("--testresultsxmlsource={0}", resultFileName2)
                , "--version=1"
            };

            optionsParser.ParseOptions(PerformanceBenchmark, args);

            // Act
            PerformanceBenchmark.AddPerformanceTestRunResults(testResultJsonParser, performanceTestRunResults, testResults, new List <TestResult>());

            // Assert
            Assert.IsTrue(PerformanceBenchmark.ResultFilesExist);
            AssertCorrectResultJsonFilePaths(new[] { resultJsonFilePath, resultFileName2 });
            Assert.NotNull(testResults);
            Assert.IsTrue(testResults.Count > 0);
            Assert.NotNull(performanceTestRunResults);
            Assert.IsTrue(performanceTestRunResults.Count > 0);
        }