From b0f510843768ff554c5b44fb0645f9a77f9a0775 Mon Sep 17 00:00:00 2001 From: Magnus Nilsson Date: Tue, 19 Mar 2019 15:34:03 +0100 Subject: [PATCH 1/2] Replace opencover with coverlet for test coverage --- .appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ebb64c6..b28b4ff 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,11 +2,10 @@ version: '{build}' skip_branch_with_pr: true image: Visual Studio 2017 install: - - ps: nuget install OpenCover -OutputDirectory packages -Version 4.7.922 - ps: dotnet tool install coveralls.net --tool-path tools build_script: - cmd: dotnet build src/Castle.Sdk -c Release -f netstandard2.0 - cmd: dotnet build src/Castle.Sdk -c Release -f net461 -test_script: - - ps: .\packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -register:user -target:dotnet.exe -targetargs:"test src/Tests/Tests.csproj" -filter:"+[Castle.Sdk*]*" -oldStyle -output:opencoverCoverage.xml - - ps: .\tools\csmacnz.coveralls.exe --opencover -i opencoverCoverage.xml --useRelativePaths --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID +test_script: + - ps: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Castle.Sdk*]*" src/Tests.csproj + - ps: .\tools\csmacnz.coveralls.exe --opencover -i src/Tests/coverage.opencover.xml --useRelativePaths --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID From caa3ee5c8666d09ad2f0f0f86cfa50e97ee90a4a Mon Sep 17 00:00:00 2001 From: Magnus Nilsson Date: Tue, 19 Mar 2019 15:34:15 +0100 Subject: [PATCH 2/2] Rearranging testcases --- .appveyor.yml | 2 +- src/Tests/{ => Sending}/When_converting_http_messages.cs | 2 +- src/Tests/{ => Sending}/When_creating_message_sender.cs | 2 +- src/Tests/{ => Sending}/When_sending_requests.cs | 2 +- src/Tests/{ => Sending}/When_sending_with_no_track.cs | 2 +- src/Tests/Tests.csproj | 6 +++++- src/Tests/When_creating_configuration.cs | 8 ++++++++ 7 files changed, 18 insertions(+), 6 deletions(-) rename src/Tests/{ => Sending}/When_converting_http_messages.cs (97%) rename src/Tests/{ => Sending}/When_creating_message_sender.cs (97%) rename src/Tests/{ => Sending}/When_sending_requests.cs (99%) rename src/Tests/{ => Sending}/When_sending_with_no_track.cs (98%) diff --git a/.appveyor.yml b/.appveyor.yml index b28b4ff..d86285f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,5 +7,5 @@ build_script: - cmd: dotnet build src/Castle.Sdk -c Release -f netstandard2.0 - cmd: dotnet build src/Castle.Sdk -c Release -f net461 test_script: - - ps: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Castle.Sdk*]*" src/Tests.csproj + - ps: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Castle.Sdk*]*" src/Tests/Tests.csproj - ps: .\tools\csmacnz.coveralls.exe --opencover -i src/Tests/coverage.opencover.xml --useRelativePaths --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID diff --git a/src/Tests/When_converting_http_messages.cs b/src/Tests/Sending/When_converting_http_messages.cs similarity index 97% rename from src/Tests/When_converting_http_messages.cs rename to src/Tests/Sending/When_converting_http_messages.cs index 6d11797..c458945 100644 --- a/src/Tests/When_converting_http_messages.cs +++ b/src/Tests/Sending/When_converting_http_messages.cs @@ -6,7 +6,7 @@ using Tests.SetUp; using Xunit; -namespace Tests +namespace Tests.Sending { public class When_converting_http_messages { diff --git a/src/Tests/When_creating_message_sender.cs b/src/Tests/Sending/When_creating_message_sender.cs similarity index 97% rename from src/Tests/When_creating_message_sender.cs rename to src/Tests/Sending/When_creating_message_sender.cs index 706b02a..182eb68 100644 --- a/src/Tests/When_creating_message_sender.cs +++ b/src/Tests/Sending/When_creating_message_sender.cs @@ -5,7 +5,7 @@ using Tests.SetUp; using Xunit; -namespace Tests +namespace Tests.Sending { public class When_creating_message_sender { diff --git a/src/Tests/When_sending_requests.cs b/src/Tests/Sending/When_sending_requests.cs similarity index 99% rename from src/Tests/When_sending_requests.cs rename to src/Tests/Sending/When_sending_requests.cs index 88c7409..2351345 100644 --- a/src/Tests/When_sending_requests.cs +++ b/src/Tests/Sending/When_sending_requests.cs @@ -10,7 +10,7 @@ using Tests.SetUp; using Xunit; -namespace Tests +namespace Tests.Sending { public class When_sending_requests { diff --git a/src/Tests/When_sending_with_no_track.cs b/src/Tests/Sending/When_sending_with_no_track.cs similarity index 98% rename from src/Tests/When_sending_with_no_track.cs rename to src/Tests/Sending/When_sending_with_no_track.cs index 03cc4ef..d989b1d 100644 --- a/src/Tests/When_sending_with_no_track.cs +++ b/src/Tests/Sending/When_sending_with_no_track.cs @@ -4,7 +4,7 @@ using FluentAssertions; using Xunit; -namespace Tests +namespace Tests.Sending { public class When_sending_with_no_track { diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index c9176fd..4d59bfc 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -10,7 +10,7 @@ - full + portable true @@ -18,6 +18,10 @@ + + all + runtime; build; native; contentfiles; analyzers + diff --git a/src/Tests/When_creating_configuration.cs b/src/Tests/When_creating_configuration.cs index b7c76b2..e586094 100644 --- a/src/Tests/When_creating_configuration.cs +++ b/src/Tests/When_creating_configuration.cs @@ -15,6 +15,14 @@ public void Should_always_add_Cookie_when_setting_blacklist(CastleConfiguration configuration.Blacklist.Should().Contain("Cookie"); } + [Theory, AutoFakeData] + public void Should_preserve_Cookie_when_setting_blacklist_to_null(CastleConfiguration configuration) + { + configuration.Blacklist = null; + + configuration.Blacklist.Should().Contain("Cookie"); + } + [Fact] public void Should_be_able_to_get_recommended_whitelist() {