diff --git a/nuspec/nuget/Cake.Frosting.Issues.DocFx.nuspec b/nuspec/nuget/Cake.Frosting.Issues.DocFx.nuspec
index 53387b65c..a84721e2a 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.DocFx.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.DocFx.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.DocFx.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting docfx
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.EsLint.nuspec b/nuspec/nuget/Cake.Frosting.Issues.EsLint.nuspec
index deae68af2..16336de76 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.EsLint.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.EsLint.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.EsLint.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider code-analysis javascript linting eslint
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.GitRepository.nuspec b/nuspec/nuget/Cake.Frosting.Issues.GitRepository.nuspec
index 8eebc9a5f..b8d510d0c 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.GitRepository.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.GitRepository.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.GitRepository.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider code-analysis linting git
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.InspectCode.nuspec b/nuspec/nuget/Cake.Frosting.Issues.InspectCode.nuspec
index ecb25f719..674e6d48e 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.InspectCode.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.InspectCode.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.InspectCode.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider codeanalysis linting inspectcode
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Markdownlint.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Markdownlint.nuspec
index bd00a2062..22a9b6102 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Markdownlint.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Markdownlint.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.Markdownlint.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting markdown markdownlint
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.MsBuild.nuspec b/nuspec/nuget/Cake.Frosting.Issues.MsBuild.nuspec
index 818c23cc5..6b0db3be6 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.MsBuild.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.MsBuild.nuspec
@@ -30,7 +30,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.MsBuild.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider code-analysis linting msbuild
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AppVeyor.nuspec b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AppVeyor.nuspec
index 7cff0c69a..51b64cb17 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AppVeyor.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AppVeyor.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.PullRequests.AppVe
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-pullrequestsystem issues pullrequest buildserver appveyor
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AzureDevOps.nuspec b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AzureDevOps.nuspec
index e1284b766..430f245dd 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AzureDevOps.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.AzureDevOps.nuspec
@@ -28,7 +28,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.PullRequests.Azure
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-pullrequestsystem issues pullrequest tfs azure-devops azure-devops-server
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.GitHubActions.nuspec b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.GitHubActions.nuspec
index caaf910dc..464451e89 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.GitHubActions.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.GitHubActions.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.PullRequests.GitHu
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-pullrequestsystem issues pullrequest buildserver github github-actions
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.nuspec b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.nuspec
index 3731b9b31..e64f050d4 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.PullRequests.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.PullRequests.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.PullRequests.
Copyright © Cake Issues contributors
Cake Script Cake-Issues CodeAnalysis Linting Issues Pull-Requests
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec
index ee032e29d..7894464c2 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Console.nuspec
@@ -29,7 +29,7 @@ The addin requires Cake Frosting 1.2.0 or higher.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-reportformat issues reporting console
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Generic.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Generic.nuspec
index 34ca60bd6..74caa1c18 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Generic.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Generic.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.Reporting.Generic.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-reportformat issues reporting html markdown razor
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Sarif.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Sarif.nuspec
index 1a1dc8098..f600accc3 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Reporting.Sarif.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Reporting.Sarif.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.Reporting.Sarif.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-reportformat issues reporting sarif
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Reporting.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Reporting.nuspec
index 39adf7094..91cdb07ae 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Reporting.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Reporting.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.Reporting.
Copyright © Cake Issues contributors
Cake Script Cake-Issues CodeAnalysis Linting Issues Reporting
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Sarif.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Sarif.nuspec
index 5806257e6..bfe3e8828 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Sarif.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Sarif.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.Sarif.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting sarif
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Frosting.Issues.Terraform.nuspec b/nuspec/nuget/Cake.Frosting.Issues.Terraform.nuspec
index df2d710f4..54768843e 100644
--- a/nuspec/nuget/Cake.Frosting.Issues.Terraform.nuspec
+++ b/nuspec/nuget/Cake.Frosting.Issues.Terraform.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Script Runners see Cake.Issues.Terraform.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting terraform
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.DocFx.nuspec b/nuspec/nuget/Cake.Issues.DocFx.nuspec
index 9b0c7da95..04b83598f 100644
--- a/nuspec/nuget/Cake.Issues.DocFx.nuspec
+++ b/nuspec/nuget/Cake.Issues.DocFx.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.DocFx.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting docfx
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.EsLint.nuspec b/nuspec/nuget/Cake.Issues.EsLint.nuspec
index 385b817ad..3c1bb6346 100644
--- a/nuspec/nuget/Cake.Issues.EsLint.nuspec
+++ b/nuspec/nuget/Cake.Issues.EsLint.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.EsLint.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider code-analysis javascript linting eslint
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.GitRepository.nuspec b/nuspec/nuget/Cake.Issues.GitRepository.nuspec
index 1948b1729..27942d041 100644
--- a/nuspec/nuget/Cake.Issues.GitRepository.nuspec
+++ b/nuspec/nuget/Cake.Issues.GitRepository.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.GitRepository.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider code-analysis linting git
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.InspectCode.nuspec b/nuspec/nuget/Cake.Issues.InspectCode.nuspec
index b21a44205..d3081834a 100644
--- a/nuspec/nuget/Cake.Issues.InspectCode.nuspec
+++ b/nuspec/nuget/Cake.Issues.InspectCode.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.InspectCode.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider codeanalysis linting inspectcode
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec
index 87ce4ed3b..f9709e2b0 100644
--- a/nuspec/nuget/Cake.Issues.Markdownlint.nuspec
+++ b/nuspec/nuget/Cake.Issues.Markdownlint.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.Markdownlint.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting markdown markdownlint
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.MsBuild.nuspec b/nuspec/nuget/Cake.Issues.MsBuild.nuspec
index 0d6bc465f..b6f3c62a3 100644
--- a/nuspec/nuget/Cake.Issues.MsBuild.nuspec
+++ b/nuspec/nuget/Cake.Issues.MsBuild.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.MsBuild.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider code-analysis linting msbuild
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.PullRequests.AppVeyor.nuspec b/nuspec/nuget/Cake.Issues.PullRequests.AppVeyor.nuspec
index 47e31bc7a..294055216 100644
--- a/nuspec/nuget/Cake.Issues.PullRequests.AppVeyor.nuspec
+++ b/nuspec/nuget/Cake.Issues.PullRequests.AppVeyor.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.PullRequests.Ap
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-pullrequestsystem issues pullrequest buildserver appveyor
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.PullRequests.AzureDevOps.nuspec b/nuspec/nuget/Cake.Issues.PullRequests.AzureDevOps.nuspec
index ed6da6602..bf79067d9 100644
--- a/nuspec/nuget/Cake.Issues.PullRequests.AzureDevOps.nuspec
+++ b/nuspec/nuget/Cake.Issues.PullRequests.AzureDevOps.nuspec
@@ -28,7 +28,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.PullRequests.Az
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-pullrequestsystem issues pullrequest tfs azure-devops azure-devops-server
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.PullRequests.GitHubActions.nuspec b/nuspec/nuget/Cake.Issues.PullRequests.GitHubActions.nuspec
index 46c5500d0..ee76968c4 100644
--- a/nuspec/nuget/Cake.Issues.PullRequests.GitHubActions.nuspec
+++ b/nuspec/nuget/Cake.Issues.PullRequests.GitHubActions.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.PullRequests.Gi
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-pullrequestsystem issues pullrequest buildserver github github-actions
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.PullRequests.nuspec b/nuspec/nuget/Cake.Issues.PullRequests.nuspec
index 3c9bfbeea..38ce9a58d 100644
--- a/nuspec/nuget/Cake.Issues.PullRequests.nuspec
+++ b/nuspec/nuget/Cake.Issues.PullRequests.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.PullRequests.
Copyright © Cake Issues contributors
Cake Script Cake-Issues CodeAnalysis Linting Issues Pull-Requests
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec b/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec
index 083a73767..5b5f9db4c 100644
--- a/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec
+++ b/nuspec/nuget/Cake.Issues.Reporting.Console.nuspec
@@ -29,7 +29,7 @@ The addin requires Cake 1.2.0 or higher.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-reportformat issues reporting console
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec b/nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec
index 554dee8cc..0fc177c7c 100644
--- a/nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec
+++ b/nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.Reporting.Gener
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-reportformat issues reporting html markdown razor
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Reporting.Sarif.nuspec b/nuspec/nuget/Cake.Issues.Reporting.Sarif.nuspec
index 0471c4b70..fa110d8ac 100644
--- a/nuspec/nuget/Cake.Issues.Reporting.Sarif.nuspec
+++ b/nuspec/nuget/Cake.Issues.Reporting.Sarif.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.Reporting.Sarif
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-reportformat issues reporting sarif
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Reporting.nuspec b/nuspec/nuget/Cake.Issues.Reporting.nuspec
index 1d5c00511..72b55eac4 100644
--- a/nuspec/nuget/Cake.Issues.Reporting.nuspec
+++ b/nuspec/nuget/Cake.Issues.Reporting.nuspec
@@ -27,7 +27,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.Reporting.
Copyright © Cake Issues contributors
Cake Script Cake-Issues CodeAnalysis Linting Issues Reporting
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Sarif.nuspec b/nuspec/nuget/Cake.Issues.Sarif.nuspec
index cd7010f92..8508a35e2 100644
--- a/nuspec/nuget/Cake.Issues.Sarif.nuspec
+++ b/nuspec/nuget/Cake.Issues.Sarif.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.Sarif.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting sarif
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.Terraform.nuspec b/nuspec/nuget/Cake.Issues.Terraform.nuspec
index aa3d164de..fc9085cfd 100644
--- a/nuspec/nuget/Cake.Issues.Terraform.nuspec
+++ b/nuspec/nuget/Cake.Issues.Terraform.nuspec
@@ -29,7 +29,7 @@ For addin compatible with Cake Frosting see Cake.Frosting.Issues.Terraform.
Copyright © Cake Issues contributors
cake cake-addin cake-issues cake-issueprovider linting terraform
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/nuspec/nuget/Cake.Issues.nuspec b/nuspec/nuget/Cake.Issues.nuspec
index bd4488ed0..0440d9d0a 100644
--- a/nuspec/nuget/Cake.Issues.nuspec
+++ b/nuspec/nuget/Cake.Issues.nuspec
@@ -25,7 +25,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
Copyright © Cake Issues contributors
cake cake-addin cake-issues code-analysis linting issues
docs\README.md
- https://github.com/cake-contrib/Cake.Issues/releases/tag/4.8.1
+ https://github.com/cake-contrib/Cake.Issues/releases/tag/4.9.0
diff --git a/src/Cake.Issues.PullRequests.Tests/Cake.Issues.PullRequests.Tests.csproj b/src/Cake.Issues.PullRequests.Tests/Cake.Issues.PullRequests.Tests.csproj
index 5f0dd18e4..3c0e330ca 100644
--- a/src/Cake.Issues.PullRequests.Tests/Cake.Issues.PullRequests.Tests.csproj
+++ b/src/Cake.Issues.PullRequests.Tests/Cake.Issues.PullRequests.Tests.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/src/Cake.Issues.Reporting.Sarif.Tests/SarifIssueReportGeneratorTests.cs b/src/Cake.Issues.Reporting.Sarif.Tests/SarifIssueReportGeneratorTests.cs
index 9b61b31c7..c86202c0c 100644
--- a/src/Cake.Issues.Reporting.Sarif.Tests/SarifIssueReportGeneratorTests.cs
+++ b/src/Cake.Issues.Reporting.Sarif.Tests/SarifIssueReportGeneratorTests.cs
@@ -967,6 +967,46 @@ public void Should_Generate_Report_With_BaseLineState_Unchanged_If_Same_Issue()
result.BaselineState.ShouldBe(BaselineState.Unchanged);
}
+ [Fact]
+ public void Should_Generate_Report_With_BaseLineState_Unchanged_If_Only_File_Link_Has_Changed()
+ {
+ // Given
+ var fixture = new SarifIssueReportFixture();
+ fixture.SarifIssueReportFormatSettings.BaselineGuid = Guid.NewGuid();
+
+ var issues =
+ new List
+ {
+ IssueBuilder
+ .NewIssue("Message Foo.", "ProviderType Foo", "ProviderName Foo")
+ .WithFileLink(new Uri("https://github.com/cake-contrib/Cake.Issues/blob/develop/src/Cake.Issues.MsBuild/BaseMsBuildLogFileFormat.cs"))
+ .Create(),
+
+ };
+
+ var existingIssues =
+ new List
+ {
+ IssueBuilder
+ .NewIssue("Message Foo.", "ProviderType Foo", "ProviderName Foo")
+ .WithFileLink(new Uri("https://github.com/cake-contrib/Cake.Issues/blob/master/src/Cake.Issues.MsBuild/BaseMsBuildLogFileFormat.cs"))
+ .Create(),
+
+ };
+
+ fixture.SarifIssueReportFormatSettings.ExistingIssues.AddRange(existingIssues);
+
+ // When
+ var logContents = fixture.CreateReport(issues);
+
+ // Then
+ var sarifLog = JsonConvert.DeserializeObject(logContents);
+
+ var run = sarifLog.Runs.ShouldHaveSingleItem();
+ var result = run.Results.ShouldHaveSingleItem();
+ result.BaselineState.ShouldBe(BaselineState.Unchanged);
+ }
+
[Fact]
public void Should_Generate_Report_With_BaseLineState_New_If_New_Issue()
{
diff --git a/src/Cake.Issues.Reporting.Sarif/SarifIssueReportGenerator.cs b/src/Cake.Issues.Reporting.Sarif/SarifIssueReportGenerator.cs
index 8e04653a4..693ca67e3 100644
--- a/src/Cake.Issues.Reporting.Sarif/SarifIssueReportGenerator.cs
+++ b/src/Cake.Issues.Reporting.Sarif/SarifIssueReportGenerator.cs
@@ -54,7 +54,10 @@ protected override FilePath InternalCreateReport(IEnumerable issues)
if (this.sarifIssueReportFormatSettings.BaselineGuid != Guid.Empty)
{
var issueComparerOnlyPersistentProperties = new IIssueComparer(true);
- var issueComparerAllProperties = new IIssueComparer(false);
+
+ // Always ignore file link, since it might contain commit ID which is different even on identical issues
+ // from different runs.
+ var issueComparerAllProperties = new IIssueComparer(IIssueProperty.FileLink);
var unchangedIssues = new List();
var updatedIssues = new List();
diff --git a/src/Cake.Issues.Terraform/TerraformIssuesAliases.cs b/src/Cake.Issues.Terraform/TerraformIssuesAliases.cs
index 99a36ec06..a485565c1 100644
--- a/src/Cake.Issues.Terraform/TerraformIssuesAliases.cs
+++ b/src/Cake.Issues.Terraform/TerraformIssuesAliases.cs
@@ -53,7 +53,7 @@ public static IIssueProvider TerraformIssuesFromFilePath(
context.NotNull();
validateOutputFilePath.NotNull();
- return context.TerraformIssuesFromFilePath(validateOutputFilePath, "/");
+ return context.TerraformIssuesFromFilePath(validateOutputFilePath, "./");
}
///
@@ -118,7 +118,7 @@ public static IIssueProvider TerraformIssuesFromContent(
context.NotNull();
validateOutput.NotNullOrWhiteSpace();
- return context.TerraformIssues(new TerraformIssuesSettings(validateOutput.ToByteArray(), "/"));
+ return context.TerraformIssues(new TerraformIssuesSettings(validateOutput.ToByteArray(), "./"));
}
///
diff --git a/src/Cake.Issues.Tests/IIssueComparerTests.cs b/src/Cake.Issues.Tests/IIssueComparerTests.cs
index b289ee391..aba9c61c0 100644
--- a/src/Cake.Issues.Tests/IIssueComparerTests.cs
+++ b/src/Cake.Issues.Tests/IIssueComparerTests.cs
@@ -1802,4 +1802,1729 @@ private static void CompareIssues(IIssue issue1, IIssue issue2, bool expectedToB
}
}
}
+
+ public sealed class TheCtorWithIgnoredProperties
+ {
+ [Fact]
+ public void Should_Throw_If_First_Issue_Is_Null()
+ {
+ // Given
+ const IIssue issue1 = null;
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+
+ // When
+ var result = Record.Exception(() =>
+ CompareIssues(IIssueProperty.None, issue1, issue2, false));
+
+ // Then
+ result.IsArgumentNullException("obj");
+ }
+
+ [Fact]
+ public void Should_Throw_If_Second_Issue_Is_Null()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ const IIssue issue2 = null;
+
+ // When
+ var result = Record.Exception(() =>
+ CompareIssues(IIssueProperty.None, issue1, issue2, false));
+
+ // Then
+ result.IsArgumentNullException("obj");
+ }
+
+ [Fact]
+ public void Should_Throw_If_Both_Are_Null()
+ {
+ // Given
+ const IIssue issue1 = null;
+ const IIssue issue2 = null;
+
+ // When
+ var result = Record.Exception(() =>
+ CompareIssues(IIssueProperty.None, issue1, issue2, true));
+
+ // Then
+ result.IsArgumentNullException("obj");
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_ProjectFileRelativePath_Is_Different_And_Property_Is_Not_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_ProjectFileRelativePath_Is_Different_And_Property_Is_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProjectFileRelativePath, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_ProjectName_Is_Different_And_Property_Is_Not_Ignored(string projectName1, string projectName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_ProjectName_Is_Different_And_Property_Is_Ignored(string projectName1, string projectName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProjectName, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_AffectedFileRelativePath_Is_Different_And_Property_Is_Not_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_AffectedFileRelativePath_Is_Different_And_Property_Is_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.AffectedFileRelativePath, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 2)]
+ [InlineData(1, null)]
+ [InlineData(null, 1)]
+ [InlineData(int.MaxValue, 1)]
+ [InlineData(1, int.MaxValue)]
+ public void Should_Return_False_If_Line_Is_Different_And_Property_Is_Not_Ignored(int? line1, int? line2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData(1, 2)]
+ [InlineData(1, null)]
+ [InlineData(null, 1)]
+ [InlineData(int.MaxValue, 1)]
+ [InlineData(1, int.MaxValue)]
+ public void Should_Return_True_If_Line_Is_Different_And_Property_Is_Ignored(int? line1, int? line2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Line, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 2)]
+ [InlineData(1, null)]
+ [InlineData(null, 1)]
+ [InlineData(int.MaxValue, 1)]
+ [InlineData(1, int.MaxValue)]
+ public void Should_Return_False_If_Column_Is_Different_And_Property_Is_Not_Ignored(int? column1, int? column2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData(1, 2)]
+ [InlineData(1, null)]
+ [InlineData(null, 1)]
+ [InlineData(int.MaxValue, 1)]
+ [InlineData(1, int.MaxValue)]
+ public void Should_Return_True_If_Column_Is_Different_And_Property_Is_Ignored(int? column1, int? column2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Column, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://bar")]
+ [InlineData("http://foo", null)]
+ [InlineData(null, "http://foo")]
+ public void Should_Return_False_If_FileLink_Is_Different_And_Property_Is_Not_Ignored(string fileLink1, string fileLink2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink1))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink2))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://bar")]
+ [InlineData("http://foo", null)]
+ [InlineData(null, "http://foo")]
+ public void Should_Return_True_If_FileLink_Is_Different_And_Property_Is_Ignored(string fileLink1, string fileLink2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink1))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink2))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.FileLink, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_False_If_MessageText_Is_Different_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message1", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message2", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_MessageText_Is_Different_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message1", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message2", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Identifier | IIssueProperty.MessageText, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_MessageHtml_Is_Different_And_Property_Is_Not_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_MessageHtml_Is_Different_And_Property_Is_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.MessageHtml, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_MessageMarkdown_Is_Different_And_Property_Is_Not_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_MessageMarkdown_Is_Different_And_Property_Is_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.MessageMarkdown, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 2)]
+ [InlineData(1, null)]
+ [InlineData(null, 1)]
+ [InlineData(int.MinValue, 0)]
+ [InlineData(int.MaxValue, 0)]
+ public void Should_Return_False_If_Priority_Is_Different_And_Property_Is_Not_Ignored(int? priority1, int? priority2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority1, "Foo")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority2, "Foo")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData(1, 2)]
+ [InlineData(1, null)]
+ [InlineData(null, 1)]
+ [InlineData(int.MinValue, 0)]
+ [InlineData(int.MaxValue, 0)]
+ public void Should_Return_True_If_Priority_Is_Different_And_Property_Is_Ignored(int? priority1, int? priority2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority1, "Foo")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority2, "Foo")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Priority, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_PriorityName_Is_Different_And_Property_Is_Not_Ignored(string priorityName1, string priorityName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_PriorityName_Is_Different_And_Property_Is_Ignored(string priorityName1, string priorityName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.PriorityName, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_False_If_Rule_Is_Different_And_Property_Is_Not_Ignored(string rule1, string rule2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("foo", "bar")]
+ [InlineData("foo", "Foo")]
+ [InlineData("foo", null)]
+ [InlineData(null, "foo")]
+ public void Should_Return_True_If_Rule_Is_Different_And_Property_Is_Ignored(string rule1, string rule2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.RuleId, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://bar")]
+ [InlineData("http://foo", null)]
+ [InlineData(null, "http://foo")]
+ public void Should_Return_False_If_RuleUrl_Is_Different_And_Property_Is_Not_Ignored(string ruleUrl1, string ruleUrl2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(ruleUrl1))
+ {
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", new Uri(ruleUrl1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(ruleUrl2))
+ {
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", new Uri(ruleUrl2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://bar")]
+ [InlineData("http://foo", null)]
+ [InlineData(null, "http://foo")]
+ public void Should_Return_True_If_RuleUrl_Is_Different_And_Property_Is_Ignored(string ruleUrl1, string ruleUrl2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ Uri ruleUri1 = null;
+ if (!string.IsNullOrEmpty(ruleUrl1))
+ {
+ ruleUri1 = new Uri(ruleUrl1);
+ }
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", ruleUri1);
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ Uri ruleUri2 = null;
+ if (!string.IsNullOrEmpty(ruleUrl2))
+ {
+ ruleUri2 = new Uri(ruleUrl2);
+ }
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", ruleUri2);
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.RuleUrl, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_False_If_ProviderType_Is_Different_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType1", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType2", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_ProviderType_Is_Different_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType1", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType2", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProviderType, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_False_If_ProviderName_Is_Different_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName1")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName2")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_ProviderName_Is_Different_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName1")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName2")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProviderName, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_False_If_Run_Is_Different_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run1")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run2")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_Run_Is_Different_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run1")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run2")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Run, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_Same_Reference()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ var issue2 = issue1;
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_Properties_Are_The_Same()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("foo", "foo/")]
+ [InlineData("foo/", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_ProjectFileRelativePath_Is_Same_And_Property_Is_Not_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("foo", "foo/")]
+ [InlineData("foo/", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_ProjectFileRelativePath_Is_Same_And_Property_Is_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProjectFileRelativePath, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_ProjectName_Is_Same_And_Property_Is_Not_Ignored(string projectName1, string projectName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_ProjectName_Is_Same_And_Property_Is_Ignored(string projectName1, string projectName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InProjectOfName(projectName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProjectName, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("foo", "foo/")]
+ [InlineData("foo/", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_AffectedFileRelativePath_Is_Same_And_Property_Is_Not_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("foo", "foo/")]
+ [InlineData("foo/", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_AffectedFileRelativePath_Is_Same_And_Property_Is_Ignored(string path1, string path2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile(path2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.AffectedFileRelativePath, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 1)]
+ [InlineData(null, null)]
+ [InlineData(int.MaxValue, int.MaxValue)]
+ public void Should_Return_True_If_Line_Is_Same_And_Property_Is_Not_Ignored(int? line1, int? line2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 1)]
+ [InlineData(null, null)]
+ [InlineData(int.MaxValue, int.MaxValue)]
+ public void Should_Return_True_If_Line_Is_Same_And_Property_Is_Ignored(int? line1, int? line2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", line2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Line, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 1)]
+ [InlineData(null, null)]
+ [InlineData(int.MaxValue, int.MaxValue)]
+ public void Should_Return_True_If_Column_Is_Same_And_Property_Is_Not_Ignored(int? column1, int? column2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 1)]
+ [InlineData(null, null)]
+ [InlineData(int.MaxValue, int.MaxValue)]
+ public void Should_Return_True_If_Column_Is_Same_And_Property_Is_Ignored(int? column1, int? column2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .InFile("foo", 42, column2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Column, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://foo")]
+ [InlineData("http://foo", "http://Foo")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_FileLink_Is_Same_And_Property_Is_Not_Ignored(string fileLink1, string fileLink2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink1))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink2))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://foo")]
+ [InlineData("http://foo", "http://Foo")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_FileLink_Is_Same_And_Property_Is_Ignored(string fileLink1, string fileLink2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink1))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(fileLink2))
+ {
+ issueBuilder =
+ issueBuilder
+ .WithFileLink(new Uri(fileLink2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.FileLink, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_MessageText_Is_Same_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("messageText", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("messageText", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_MessageText_Is_Same_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("messageText", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("messageText", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.MessageText, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_MessageHtml_Is_Same_And_Property_Is_Not_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_MessageHtml_Is_Same_And_Property_Is_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInHtmlFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.MessageHtml, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_MessageMarkdown_Is_Same_And_Property_Is_Not_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_MessageMarkdown_Is_Same_And_Property_Is_Ignored(string message1, string message2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithMessageInMarkdownFormat(message2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.MessageMarkdown, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 1)]
+ [InlineData(null, null)]
+ [InlineData(0, 0)]
+ [InlineData(int.MinValue, int.MinValue)]
+ [InlineData(int.MaxValue, int.MaxValue)]
+ public void Should_Return_True_If_Priority_Is_Same_And_Property_Is_Not_Ignored(int? priority1, int? priority2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority1, "Foo")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority2, "Foo")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData(1, 1)]
+ [InlineData(null, null)]
+ [InlineData(0, 0)]
+ [InlineData(int.MinValue, int.MinValue)]
+ [InlineData(int.MaxValue, int.MaxValue)]
+ public void Should_Return_True_If_Priority_Is_Same_And_Property_Is_Ignored(int? priority1, int? priority2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority1, "Foo")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(priority2, "Foo")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Priority, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_PriorityName_Is_Same_And_Property_Is_Not_Ignored(string priorityName1, string priorityName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_PriorityName_Is_Same_And_Property_Is_Ignored(string priorityName1, string priorityName2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithPriority(42, priorityName2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.PriorityName, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_Rule_Is_Same_And_Property_Is_Not_Ignored(string rule1, string rule2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("foo", "foo")]
+ [InlineData("", "")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_Rule_Is_Same_And_Property_Is_Ignored(string rule1, string rule2)
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule1)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .OfRule(rule2)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.RuleId, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://foo")]
+ [InlineData("http://foo", "http://Foo")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_RuleUrl_Is_Same_And_Property_Is_Not_Ignored(string ruleUrl1, string ruleUrl2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(ruleUrl1))
+ {
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", new Uri(ruleUrl1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(ruleUrl2))
+ {
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", new Uri(ruleUrl2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Theory]
+ [InlineData("http://foo", "http://foo")]
+ [InlineData("http://foo", "http://Foo")]
+ [InlineData(null, null)]
+ public void Should_Return_True_If_RuleUrl_Is_Same_And_Property_Is_Ignored(string ruleUrl1, string ruleUrl2)
+ {
+ // Given
+ var issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(ruleUrl1))
+ {
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", new Uri(ruleUrl1));
+ }
+
+ var issue1 = issueBuilder.Create();
+
+ issueBuilder =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName");
+ if (!string.IsNullOrEmpty(ruleUrl2))
+ {
+ issueBuilder =
+ issueBuilder
+ .OfRule("foo", new Uri(ruleUrl2));
+ }
+
+ var issue2 = issueBuilder.Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.RuleUrl, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_ProviderType_Is_Same_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_ProviderType_Is_Same_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProviderType, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_AdditionalInformation_Is_Same_And_Property_Is_Not_Ignored()
+ {
+ const string id = "123";
+ const string lastname = "Kelso";
+ const string firstName = "Haley";
+
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", firstName)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", firstName)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_AdditionalInformation_Is_Same_And_Property_Is_Ignored()
+ {
+ const string id = "123";
+ const string lastname = "Kelso";
+ const string firstName = "Haley";
+
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", firstName)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", firstName)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.AdditionalInformation, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_False_If_AdditionalInformation_Is_Not_Same_And_Property_Is_Not_Ignored()
+ {
+ const string id = "123";
+ const string lastname = "Kelso";
+ const string correctFirstName = "Haley";
+ const string wrongFirstName = "Michael";
+
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", correctFirstName)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", wrongFirstName)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, false);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_AdditionalInformation_Is_Not_Same_And_Property_Is_Ignored()
+ {
+ const string id = "123";
+ const string lastname = "Kelso";
+ const string correctFirstName = "Haley";
+ const string wrongFirstName = "Michael";
+
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", correctFirstName)
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .WithAdditionalInformation("Id", id)
+ .WithAdditionalInformation("Lastname", lastname)
+ .WithAdditionalInformation("Firstname", wrongFirstName)
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.AdditionalInformation, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_ProviderName_Is_Same_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_ProviderName_Is_Same_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.ProviderName, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_Run_Is_Same_And_Property_Is_Not_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.None, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Return_True_If_Run_Is_Same_And_Property_Is_Ignored()
+ {
+ // Given
+ var issue1 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message", "providerType", "providerName")
+ .ForRun("run")
+ .Create();
+
+ // When / Then
+ CompareIssues(IIssueProperty.Run, issue1, issue2, true);
+ }
+
+ [Fact]
+ public void Should_Remove_Identical_Issues_From_List_Of_Issues()
+ {
+ // Given
+ var issue1_1 =
+ IssueBuilder
+ .NewIssue("message1", "providerType1", "providerName1")
+ .Create();
+ var issue1_2 =
+ IssueBuilder
+ .NewIssue("message1", "providerType1", "providerName1")
+ .Create();
+ var issue2 =
+ IssueBuilder
+ .NewIssue("message2", "providerType2", "providerName2")
+ .Create();
+ var issue3 =
+ IssueBuilder
+ .NewIssue("message3", "providerType3", "providerName3")
+ .Create();
+ var issues1 = new List { issue1_1, issue2 };
+ var issues2 = new List { issue1_2, issue3 };
+ var comparer = new IIssueComparer();
+
+ // When
+ var result = issues1.Except(issues2, comparer).ToList();
+
+ // Then
+ result.Count.ShouldBe(1);
+ result.ShouldContain(issue2);
+ }
+
+ private static void CompareIssues(IIssueProperty ignoredProperties, IIssue issue1, IIssue issue2, bool expectedToBeEqual)
+ {
+ var comparer = new IIssueComparer(ignoredProperties);
+
+ comparer.Equals(issue1, issue2).ShouldBe(expectedToBeEqual);
+
+ if (expectedToBeEqual)
+ {
+ comparer.GetHashCode(issue1).ShouldBe(comparer.GetHashCode(issue2));
+ }
+ else
+ {
+ comparer.GetHashCode(issue1).ShouldNotBe(comparer.GetHashCode(issue2));
+ }
+ }
+ }
}
diff --git a/src/Cake.Issues/IIssueComparer.cs b/src/Cake.Issues/IIssueComparer.cs
index e3219171b..a44abc2eb 100644
--- a/src/Cake.Issues/IIssueComparer.cs
+++ b/src/Cake.Issues/IIssueComparer.cs
@@ -6,38 +6,7 @@
///
/// Comparer to compare if two issues are identical.
///
-/// Flag indicating whether properties which
-/// are affected by changes in files should be considered while comparing issues.
-/// If set to true, the comparer can be used to compare issues from different
-/// build runs, where files might have been changed or renamed.
-///
-/// If is set to true the following
-/// properties will be ignored while comparing the issue:
-///
-/// -
-///
-///
-/// -
-///
-///
-/// -
-///
-///
-/// -
-///
-///
-/// -
-///
-///
-/// -
-///
-///
-/// -
-///
-///
-///
-///
-public class IIssueComparer(bool compareOnlyPersistentProperties) : IEqualityComparer
+public class IIssueComparer(IIssueProperty ignoredProperties) : IEqualityComparer
{
///
/// Initializes a new instance of the class.
@@ -48,79 +17,196 @@ public IIssueComparer()
{
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Flag indicating whether properties which
+ /// are affected by changes in files should be considered while comparing issues.
+ /// If set to true, the comparer can be used to compare issues from different
+ /// build runs, where files might have been changed or renamed.
+ ///
+ /// If is set to true the following
+ /// properties will be ignored while comparing the issue:
+ ///
+ /// -
+ ///
+ ///
+ /// -
+ ///
+ ///
+ /// -
+ ///
+ ///
+ /// -
+ ///
+ ///
+ /// -
+ ///
+ ///
+ /// -
+ ///
+ ///
+ /// -
+ ///
+ ///
+ ///
+ ///
+ public IIssueComparer(bool compareOnlyPersistentProperties)
+ : this(compareOnlyPersistentProperties
+ ? IIssueProperty.ProjectFileRelativePath |
+ IIssueProperty.AffectedFileRelativePath |
+ IIssueProperty.Line |
+ IIssueProperty.EndLine |
+ IIssueProperty.Column |
+ IIssueProperty.EndColumn |
+ IIssueProperty.FileLink
+ : IIssueProperty.None)
+ {
+ }
+
///
public bool Equals(IIssue x, IIssue y) =>
ReferenceEquals(x, y) ||
(
x is not null &&
y is not null &&
- (x.Identifier == y.Identifier) &&
- (compareOnlyPersistentProperties || x.ProjectFileRelativePath?.FullPath == y.ProjectFileRelativePath?.FullPath) &&
- (x.ProjectName == y.ProjectName) &&
- (compareOnlyPersistentProperties || x.AffectedFileRelativePath?.FullPath == y.AffectedFileRelativePath?.FullPath) &&
- (compareOnlyPersistentProperties || x.Line == y.Line) &&
- (compareOnlyPersistentProperties || x.EndLine == y.EndLine) &&
- (compareOnlyPersistentProperties || x.Column == y.Column) &&
- (compareOnlyPersistentProperties || x.EndColumn == y.EndColumn) &&
- (compareOnlyPersistentProperties || x.FileLink == y.FileLink) &&
- (x.MessageText == y.MessageText) &&
- (x.MessageHtml == y.MessageHtml) &&
- (x.MessageMarkdown == y.MessageMarkdown) &&
- (x.Priority == y.Priority) &&
- (x.PriorityName == y.PriorityName) &&
- (x.RuleId == y.RuleId) &&
- (x.RuleName == y.RuleName) &&
- (x.RuleUrl?.ToString() == y.RuleUrl?.ToString()) &&
- (x.Run == y.Run) &&
- (x.ProviderType == y.ProviderType) &&
- (x.ProviderName == y.ProviderName) &&
- DictionaryContentEquals(x.AdditionalInformation, y.AdditionalInformation));
+ (ignoredProperties.HasFlag(IIssueProperty.Identifier) || x.Identifier == y.Identifier) &&
+ (ignoredProperties.HasFlag(IIssueProperty.ProjectFileRelativePath) || x.ProjectFileRelativePath?.FullPath == y.ProjectFileRelativePath?.FullPath) &&
+ (ignoredProperties.HasFlag(IIssueProperty.ProjectName) || x.ProjectName == y.ProjectName) &&
+ (ignoredProperties.HasFlag(IIssueProperty.AffectedFileRelativePath) || x.AffectedFileRelativePath?.FullPath == y.AffectedFileRelativePath?.FullPath) &&
+ (ignoredProperties.HasFlag(IIssueProperty.Line) || x.Line == y.Line) &&
+ (ignoredProperties.HasFlag(IIssueProperty.EndLine) || x.EndLine == y.EndLine) &&
+ (ignoredProperties.HasFlag(IIssueProperty.Column) || x.Column == y.Column) &&
+ (ignoredProperties.HasFlag(IIssueProperty.EndColumn) || x.EndColumn == y.EndColumn) &&
+ (ignoredProperties.HasFlag(IIssueProperty.FileLink) || x.FileLink == y.FileLink) &&
+ (ignoredProperties.HasFlag(IIssueProperty.MessageText) || x.MessageText == y.MessageText) &&
+ (ignoredProperties.HasFlag(IIssueProperty.MessageHtml) || x.MessageHtml == y.MessageHtml) &&
+ (ignoredProperties.HasFlag(IIssueProperty.MessageMarkdown) || x.MessageMarkdown == y.MessageMarkdown) &&
+ (ignoredProperties.HasFlag(IIssueProperty.Priority) || x.Priority == y.Priority) &&
+ (ignoredProperties.HasFlag(IIssueProperty.PriorityName) || x.PriorityName == y.PriorityName) &&
+ (ignoredProperties.HasFlag(IIssueProperty.RuleId) || x.RuleId == y.RuleId) &&
+ (ignoredProperties.HasFlag(IIssueProperty.RuleName) || x.RuleName == y.RuleName) &&
+ (ignoredProperties.HasFlag(IIssueProperty.RuleUrl) || x.RuleUrl?.ToString() == y.RuleUrl?.ToString()) &&
+ (ignoredProperties.HasFlag(IIssueProperty.Run) || x.Run == y.Run) &&
+ (ignoredProperties.HasFlag(IIssueProperty.ProviderType) || x.ProviderType == y.ProviderType) &&
+ (ignoredProperties.HasFlag(IIssueProperty.ProviderName) || x.ProviderName == y.ProviderName) &&
+ (ignoredProperties.HasFlag(IIssueProperty.AdditionalInformation) || DictionaryContentEquals(x.AdditionalInformation, y.AdditionalInformation)));
///
public int GetHashCode(IIssue obj)
{
obj.NotNull(nameof(obj));
- return compareOnlyPersistentProperties
- ? GetHashCode(
- obj.Identifier,
- obj.ProjectName,
- obj.MessageText,
- obj.MessageHtml,
- obj.MessageMarkdown,
- obj.Priority,
- obj.PriorityName,
- obj.RuleId,
- obj.RuleName,
- obj.RuleUrl,
- obj.Run,
- obj.ProviderType,
- obj.ProviderName) +
- GetDictionaryHashCode(
- obj.AdditionalInformation)
- : GetHashCode(
- obj.Identifier,
- obj.ProjectFileRelativePath?.ToString(),
- obj.ProjectName,
- obj.AffectedFileRelativePath?.ToString(),
- obj.Line,
- obj.EndLine,
- obj.Column,
- obj.EndColumn,
- obj.FileLink,
- obj.MessageText,
- obj.MessageHtml,
- obj.MessageMarkdown,
- obj.Priority,
- obj.PriorityName,
- obj.RuleId,
- obj.RuleName,
- obj.RuleUrl,
- obj.Run,
- obj.ProviderType,
- obj.ProviderName) +
- GetDictionaryHashCode(
- obj.AdditionalInformation);
+ var valuesToHash = new List