public void EmptyReport_GivenAnOutput_OutputsSamplePost() { const string outfile = "TestingOutput.xml"; var(fileSystem, coverageFolderPath) = BuildMonocovReportFolder(); var results = CoverallsTestRunner.RunCoveralls( $"--monocov -i {coverageFolderPath} --dryrun --output {outfile} --repoToken MYTESTREPOTOKEN", fileSystem); CoverallsAssert.RanSuccessfully(results); var savedFile = fileSystem.TryLoadFile(outfile); Assert.True(savedFile.HasValue, "Expected file to exist in fileSystem"); var savedFileData = savedFile.ValueOr(" "); Assert.Contains(@"""repo_token"":""MYTESTREPOTOKEN""", savedFileData, StringComparison.Ordinal); Assert.Contains(@"""service_name"":""coveralls.net""", savedFileData, StringComparison.Ordinal); Assert.Contains(@"""parallel"":false", savedFileData, StringComparison.Ordinal); var jObject = AssertValidJson(savedFileData); Assert.Equal("MYTESTREPOTOKEN", jObject.Value <string>("repo_token")); Assert.Equal("coveralls.net", jObject.Value <string>("service_name")); Assert.False(jObject.Value <bool?>("parallel")); Assert.Collection( (JArray?)jObject.GetValue("source_files", StringComparison.Ordinal), i => AssertIsValidCoverageFileData(i, "GameOfLife/Game.cs"), i => AssertIsValidCoverageFileData(i, "GameOfLife/Program.cs"), i => AssertIsValidCoverageFileData(i, "GameOfLife/World.cs"), i => AssertIsValidCoverageFileData(i, "GameOfLife/WorldBuilder.cs"), i => AssertIsValidCoverageFileData(i, "GameOfLife.xUnit.Tests/WorldTests.cs")); }
public void HelpShortHand() { var results = CoverallsTestRunner.RunCoveralls("-h"); CoverallsAssert.RanSuccessfully(results); CoverallsAssert.ContainsStandardUsageText(results); }
public void CompleteParallelCommandWithServiceBuildNumberWorks() { var results = CoverallsTestRunner.RunCoveralls( "--completeParallelWork --repoToken MYTESTREPOTOKEN --serviceNumber 1234"); CoverallsAssert.RanSuccessfully(results); }
public void ReportWithOneFile_MultipleMode_RunsSuccessfully() { var(fileSystem, coverageFolderPath) = BuildMonocovReportFolder(); var results = DryRunCoverallsMultiModeWithInputFile(coverageFolderPath, fileSystem); CoverallsAssert.RanSuccessfully(results); }
public void ReportWithOneFile_RunsSuccessfully() { var(fileSystem, coverageFilePath) = BuildReportWithOneFile(); var results = DryRunCoverallsWithInputFile(coverageFilePath, fileSystem); CoverallsAssert.RanSuccessfully(results); }
public void EmptyReport_MultipleMode_RunsSuccessfully() { var directoryPath = TestFileSystem.GenerateRandomAbsolutePath("reports", "Sample1"); var fileSystem = EmptyReportFileSystem(directoryPath); var results = DryRunCoverallsMultiModeWithInputFile(directoryPath, fileSystem); CoverallsAssert.RanSuccessfully(results); }
public void EmptyReport_MultipleMode_RunsSuccessfully() { var fileSystem = new TestFileSystem(); var filePath = TestFileSystem.GenerateRandomAbsolutePath("opencover", "Sample1", "EmptyReport.xml"); fileSystem.AddFile(filePath, Reports.OpenCoverSamples.EmptyReport); var results = DryRunCoverallsMultiModeWithInputFile(filePath, fileSystem); CoverallsAssert.RanSuccessfully(results); }
public void EmptyReport_RunsSuccessfully() { var fileSystem = new TestFileSystem(); string filePath = TestFileSystem.GenerateRandomAbsolutePath("ncover", "EmptyReport.xml"); fileSystem.AddFile(filePath, Reports.NCoverSamples.EmptyReport); var results = DryRunCoverallsWithInputFile(filePath, fileSystem); CoverallsAssert.RanSuccessfully(results); }
public void EmptyReport_MultipleMode_RunsSuccessfully() { var fileSystem = new TestFileSystem(); var directoryPath = TestFileSystem.GenerateRandomAbsolutePath("reports", "Sample1"); fileSystem.AddFile(Path.Combine(directoryPath, "Summary.xml"), Reports.ReportGeneratorSample.Sample1.Summary); fileSystem.AddFile(Path.Combine(directoryPath, "test_test.UnitTest1.xml"), Reports.ReportGeneratorSample.Sample1.Test_test_UnitTest1); var results = DryRunCoverallsMultiModeWithInputFile(directoryPath, fileSystem); CoverallsAssert.RanSuccessfully(results); }
public void CompleteParallelCommandWithTokenVariableWorks() { var environment = new TestEnvironmentVariables(new Dictionary <string, string> { { "MYTESTREPOTOKENVAR", "MYTESTREPOTOKEN" } }); var results = CoverallsTestRunner.RunCoveralls( "--completeParallelWork --repoTokenVariable MYTESTREPOTOKENVAR", testEnvironmentVariables: environment); CoverallsAssert.RanSuccessfully(results); }
public void CompleteParallelCommandWithEnvironmentVariablesWorks() { var environment = new TestEnvironmentVariables(new Dictionary <string, string> { { "COVERALLS_REPO_TOKEN", "MYTESTREPOTOKEN" }, { "APPVEYOR_BUILD_NUMBER", "1234" } }); var results = CoverallsTestRunner.RunCoveralls( "--completeParallelWork", testEnvironmentVariables: environment); CoverallsAssert.RanSuccessfully(results); }
public void EmptyReport_GivenAnOutput_OutputsSamplePost() { var fileSystem = new TestFileSystem(); var outfile = "TestingOutput.xml"; var filePath = TestFileSystem.GenerateRandomAbsolutePath("opencover", "Sample1", "EmptyReport.xml"); fileSystem.AddFile(filePath, Reports.OpenCoverSamples.EmptyReport); var results = CoverallsTestRunner.RunCoveralls( $"--opencover -i {filePath} --dryrun --output {outfile} --repoToken MYTESTREPOTOKEN", fileSystem); CoverallsAssert.RanSuccessfully(results); var savedFile = fileSystem.TryLoadFile(outfile); Assert.True(savedFile.HasValue, "Expected file to exist in fileSystem"); var savedFileData = savedFile.ValueOr(" "); Assert.Contains(@"""repo_token"":""MYTESTREPOTOKEN""", savedFileData, StringComparison.Ordinal); Assert.Contains(@"""service_name"":""coveralls.net""", savedFileData, StringComparison.Ordinal); Assert.Contains(@"""parallel"":false", savedFileData, StringComparison.Ordinal); Assert.Contains(@"""source_files"":[]", savedFileData, StringComparison.Ordinal); }
public void CompleteParallelCommandWithTokenWorks() { var results = CoverallsTestRunner.RunCoveralls("--completeParallelWork --repoToken MYTESTREPOTOKEN"); CoverallsAssert.RanSuccessfully(results); }