Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadek Zikmund <32671551+rzikm@users.noreply.github.com>2022-03-08 20:44:17 +0300
committerGitHub <noreply@github.com>2022-03-08 20:44:17 +0300
commit00ed84ae9ba5c68ada6041ca4aa8083cc89e0669 (patch)
tree761542d729c1aa412ab77bc08012d9f5d02f018d /src/libraries/System.Net.Security/tests/UnitTests
parent627851323fe8f15539c163aabd7d7c644766c549 (diff)
Mark EncryptionPolicy.NoEncryption and EncryptionPolicy.AllowNoEncryption as obsolete (#66292)
Fixes #65545
Diffstat (limited to 'src/libraries/System.Net.Security/tests/UnitTests')
-rw-r--r--src/libraries/System.Net.Security/tests/UnitTests/SslAuthenticationOptionsTests.cs2
-rw-r--r--src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libraries/System.Net.Security/tests/UnitTests/SslAuthenticationOptionsTests.cs b/src/libraries/System.Net.Security/tests/UnitTests/SslAuthenticationOptionsTests.cs
index 3ce795a5d42..f1ce91870d8 100644
--- a/src/libraries/System.Net.Security/tests/UnitTests/SslAuthenticationOptionsTests.cs
+++ b/src/libraries/System.Net.Security/tests/UnitTests/SslAuthenticationOptionsTests.cs
@@ -150,11 +150,13 @@ namespace System.Net.Security.Tests
Assert.Equal(EncryptionPolicy.RequireEncryption, _clientOptions.EncryptionPolicy);
Assert.Equal(EncryptionPolicy.RequireEncryption, _serverOptions.EncryptionPolicy);
+#pragma warning disable SYSLIB0040 // NoEncryption and AllowNoEncryption are obsolete
_clientOptions.EncryptionPolicy = EncryptionPolicy.AllowNoEncryption;
_serverOptions.EncryptionPolicy = EncryptionPolicy.NoEncryption;
Assert.Equal(EncryptionPolicy.AllowNoEncryption, _clientOptions.EncryptionPolicy);
Assert.Equal(EncryptionPolicy.NoEncryption, _serverOptions.EncryptionPolicy);
+#pragma warning restore SYSLIB0040
Assert.Throws<ArgumentException>(() => _clientOptions.EncryptionPolicy = (EncryptionPolicy)3);
Assert.Throws<ArgumentException>(() => _serverOptions.EncryptionPolicy = (EncryptionPolicy)3);
diff --git a/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj b/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj
index 0fd7b6b55f4..afd15272ed6 100644
--- a/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj
+++ b/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj
@@ -74,6 +74,8 @@
Link="Common\Interop\Windows\SChannel\Interop.Alerts.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
+ <Compile Include="$(CommonPath)System\Obsoletions.cs"
+ Link="Common\System\Obsoletions.cs" />
<!-- Logging -->
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="ProductionCode\Common\System\Net\Logging\NetEventSource.Common.cs" />