Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            string baseDirectory = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\..\.."));

            FileDifferencesSerializer.ToFile(
                Path.Combine(baseDirectory, @"..\restsharp.json"),
                CodeCoverageComparison.CompareFileContent(File.ReadAllText(args[0]), File.ReadAllText(args[1])));

            /*(new CodeCoverageRunner()
             * {
             *  PathToOpenCover = Path.Combine(baseDirectory, @"RestSharp\packages\OpenCover.4.5.3723\OpenCover.Console.exe"),
             *  PathToReportGenerator = Path.Combine(baseDirectory, @"RestSharp\packages\ReportGenerator.2.1.4.0\ReportGenerator.exe"),
             *  PathToTestRunner = Path.Combine(baseDirectory, @"RestSharp\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe"),
             *  TestRunnerArguments = "\"\"" + Path.Combine(baseDirectory, @"RestSharp\RestSharp.IntegrationTests\bin\Debug\RestSharp.IntegrationTests.dll") + @""""" -method RestSharp.IntegrationTests.FileTests.Handles_Binary_File_Download -noshadow",
             *  PathToCodeCoverageXmlFile = Path.Combine(baseDirectory, @"RestSharp\Coverage2.xml"),
             *  PathToCodeCoverageReportDirectory = Path.Combine(baseDirectory, @"RestSharp\Coverage2"),
             *  CodeCoverageFilter = @"+[RestSharp*]*"
             * }).RunCodeCoverage();*/
        }
 public void Test_CompareFileContent_ShouldReturnOneFileDifferenceWhenOnlyOnePartialClassHasChanged()
 {
     CodeCoverageComparison.CompareFileContent(
         CodeCoverageComparisonTestResources.RestSharp_RestClient_Old,
         CodeCoverageComparisonTestResources.RestSharp_RestClient_New).Should().ContainSingle();
 }
 public void Test_CompareFileContent_ShouldReturnOnNullIfThereIsNoCoverageChange()
 {
     CodeCoverageComparison.CompareFileContent(
         "OLD:" + CodeCoverageComparisonTestResources.RestSharp_RestClient_New,
         CodeCoverageComparisonTestResources.RestSharp_RestClient_New).Should().BeNull();
 }
        public void Test_CompareFileContent_ShouldReturnNullIfBothFilesHaveNoCoverage()
        {
            const string matchText = "<tr><th>Coverage:</th><td>0%</td></tr>";

            CodeCoverageComparison.CompareFileContent("old" + matchText, "new" + matchText).Should().BeNull();
        }
 public void Test_CompareFileContent_ShouldReturnNullIfFilesAreIdentical()
 {
     CodeCoverageComparison.CompareFileContent("test", "test").Should().BeNull();
 }
 public void Test_CompareFileContent_ShouldReturnNullIfNewFileContentIsNull()
 {
     CodeCoverageComparison.CompareFileContent("test", null).Should().BeNull();
 }
 public void Test_CompareFileContent_ShouldReturnNullIfOldFileContentIsNull()
 {
     CodeCoverageComparison.CompareFileContent(null, "test").Should().BeNull();
 }