Exemplo n.º 1
0
        public void VerifyV2_Verify_AddBaselineAndNonBaselinePerformanceTestRunResults()
        {
            // Arrange
            var resultJsonFilePath   = EnsureFullPath("results2.json");
            var baselineJsonFilePath = EnsureFullPath("baseline2.json");
            var args = new[]
            {
                "--format=Json",
                string.Format("--testresultsxmlsource={0}", resultJsonFilePath),
                string.Format("--baselinexmlsource={0}", baselineJsonFilePath)
                , "--version=2"
            };

            optionsParser.ParseOptions(PerformanceBenchmark, args);

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

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

            Assert.IsTrue(PerformanceBenchmark.BaselineResultFilesExist);
            AssertCorrectBaselineJsonFilePaths(new[] { baselineJsonFilePath });
            Assert.NotNull(baselineTestResults);
            Assert.IsTrue(baselineTestResults.Count > 0);
            Assert.NotNull(baselinePerformanceTestRunResults);
            Assert.IsTrue(baselinePerformanceTestRunResults.Count > 0);
        }
Exemplo n.º 2
0
        public void VerifyV1_AddBaselinePerformanceTestRunResultsDirectory()
        {
            // Arrange
            var resultJsonFilePath   = EnsureFullPath("ResultsJson");
            var baselineJsonFilePath = EnsureFullPath("BaselineJson");
            var args = new[]
            {
                "--format=Json",
                string.Format("--testresultsxmlsource={0}", resultJsonFilePath),
                string.Format("--baselinexmlsource={0}", baselineJsonFilePath)
                , "--version=1"
            };

            optionsParser.ParseOptions(PerformanceBenchmark, args);

            // Act
            PerformanceBenchmark.AddBaselinePerformanceTestRunResults(testResultJsonParser, baselinePerformanceTestRunResults, baselineTestResults);

            // Assert
            Assert.IsTrue(PerformanceBenchmark.BaselineResultFilesExist);
            Assert.NotNull(baselineTestResults);
            Assert.IsTrue(baselineTestResults.Count > 0);
            Assert.NotNull(baselinePerformanceTestRunResults);
            Assert.IsTrue(baselinePerformanceTestRunResults.Count > 0);
        }
        public void Verify_AddBaselinePerformanceTestRunResultsDirectory()
        {
            // 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);

            // Assert
            Assert.IsTrue(PerformanceBenchmark.BaselineResultFilesExist);
            Assert.NotNull(baselineTestResults);
            Assert.IsTrue(baselineTestResults.Count > 0);
            Assert.NotNull(baselinePerformanceTestRunResults);
            Assert.IsTrue(baselinePerformanceTestRunResults.Count > 0);
        }