diff --git a/build/strongNameBypass.reg b/build/strongNameBypass.reg index f7ef979717..95fc527e5a 100644 Binary files a/build/strongNameBypass.reg and b/build/strongNameBypass.reg differ diff --git a/build/strongNameBypass2.reg b/build/strongNameBypass2.reg index 6378c78408..5786446bac 100644 Binary files a/build/strongNameBypass2.reg and b/build/strongNameBypass2.reg differ diff --git a/runTests.ps1 b/runTests.ps1 index 942f5e019a..2d0571437c 100644 --- a/runTests.ps1 +++ b/runTests.ps1 @@ -52,8 +52,8 @@ foreach ($testProject in $testProjects) Write-Host ">>> Set-Location $root\test\$name" pushd Set-Location $root\test\$name - Write-Host ">>> Start-Process -wait -passthru -NoNewWindow $dotnetexe 'test $name.csproj'--no-build --no-restore -nodereuse:false -v d -c $buildType" - $p = Start-Process -wait -passthru -NoNewWindow $dotnetexe "test $name.csproj --no-build --no-restore -nodereuse:false -v d -c $buildType" + Write-Host ">>> Start-Process -Wait -PassThru -NoNewWindow $dotnetexe 'test $name.csproj' --filter category!=nonwindowstests --no-build --no-restore -nodereuse:false -v n -c $buildType" + $p = Start-Process -Wait -PassThru -NoNewWindow $dotnetexe "test $name.csproj --filter category!=nonwindowstests --no-build --no-restore -nodereuse:false -v n -c $buildType" if($p.ExitCode -ne 0) { diff --git a/runtests.cmd b/runtests.cmd new file mode 100644 index 0000000000..a9b9a8d834 --- /dev/null +++ b/runtests.cmd @@ -0,0 +1,2 @@ +@ECHO OFF +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0runtests.ps1' %*; exit $LASTEXITCODE" diff --git a/src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2AuthenticationContext.cs b/src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2AuthenticationContext.cs index b021de511c..85a4635771 100644 --- a/src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2AuthenticationContext.cs +++ b/src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2AuthenticationContext.cs @@ -119,10 +119,7 @@ public Uri DeclarationReference get { return _declarationReference; } set { - if (value == null) - throw LogArgumentNullException(nameof(value)); - - if (!value.IsAbsoluteUri) + if (value != null && !value.IsAbsoluteUri) throw LogExceptionMessage(new ArgumentException(FormatInvariant(LogMessages.IDX13300, nameof(DeclarationReference), value))); _declarationReference = value; diff --git a/test/Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2AuthenticationContextTests.cs b/test/Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2AuthenticationContextTests.cs index 94b4d9524e..31af11e006 100644 --- a/test/Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2AuthenticationContextTests.cs +++ b/test/Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2AuthenticationContextTests.cs @@ -61,8 +61,7 @@ public void Saml2AuthenticationContext_CtorNullClassAndDeclaration_ArgumentNullE [Fact] public void Saml2AuthenticationContext_CtorNullDeclaration_ArgumentNullException() { - var classRef = new Uri("http://resource", UriKind.Absolute); - Assert.Throws(() => new Saml2AuthenticationContext(classRef, null)); + new Saml2AuthenticationContext(new Uri("http://resource", UriKind.Absolute), null); } [Fact] @@ -117,10 +116,12 @@ public void Saml2AuthenticationContext_AbsoluteDeclarationReference_NoException( } [Fact] - public void Saml2AuthenticationContext_NullDeclarationReference_ArgumentNullException() + public void Saml2AuthenticationContext_NullDeclarationReference() { - var authContext = new Saml2AuthenticationContext(); - Assert.Throws(() => authContext.DeclarationReference = null); + new Saml2AuthenticationContext + { + DeclarationReference = null + }; } } }