Skip to content

Commit 1d4c6bf

Browse files
[master] Update dependencies from dotnet/arcade dotnet/runtime (dotnet/extensions#3383)
[master] Update dependencies from dotnet/arcade dotnet/runtime - Updates: - System.ComponentModel.Annotations: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Diagnostics.DiagnosticSource: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Diagnostics.EventLog: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.Abstractions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.Configuration: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.Console: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.Debug: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.EventLog: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.EventSource: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Logging.TraceSource: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Options: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Options.ConfigurationExtensions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Options.DataAnnotations: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Primitives: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Http: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Hosting: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Caching.Abstractions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Caching.Memory: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.Abstractions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.Binder: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.CommandLine: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.EnvironmentVariables: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.FileExtensions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.Ini: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.Json: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.UserSecrets: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Configuration.Xml: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.DependencyInjection: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.DependencyInjection.Abstractions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.FileProviders.Abstractions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.FileProviders.Composite: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.FileProviders.Physical: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.FileSystemGlobbing: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Extensions.Hosting.Abstractions: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.NETCore.App.Runtime.win-x64: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.NETCore.Platforms: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.Win32.Registry: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.NETCore.App.Internal: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Microsoft.NETCore.App.Ref: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Text.Encodings.Web: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Text.Json: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.ServiceProcess.ServiceController: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.IO.Pipelines: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Reflection.Metadata: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Runtime.CompilerServices.Unsafe: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Security.Cryptography.Cng: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - System.Security.Cryptography.Xml: from 5.0.0-rc.1.20371.13 to 5.0.0-rc.1.20414.1 - Updates: - Microsoft.DotNet.GenAPI: from 5.0.0-beta.20364.3 to 5.0.0-beta.20403.5 - Microsoft.DotNet.Arcade.Sdk: from 5.0.0-beta.20364.3 to 5.0.0-beta.20403.5 - Microsoft.DotNet.Helix.Sdk: from 5.0.0-beta.20364.3 to 5.0.0-beta.20403.5 - Fix breaking change in System.Net.Http\n\nCommit migrated from dotnet/extensions@97b7eda
1 parent 7cd363f commit 1d4c6bf

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/HttpClientFactory/Polly/test/HttpRequestMessageExtensionsTest.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -16,7 +16,11 @@ public void GetPolicyExecutionContext_Found_SetsContext()
1616
// Arrange
1717
var request = new HttpRequestMessage();
1818
var expected = new Context(Guid.NewGuid().ToString());
19+
#if USE_OBSOLETED
1920
request.Properties[HttpRequestMessageExtensions.PolicyExecutionContextKey] = expected;
21+
#else
22+
request.Options.Set(new HttpRequestOptionsKey<Context>(HttpRequestMessageExtensions.PolicyExecutionContextKey), expected);
23+
#endif
2024

2125
// Act
2226
var actual = request.GetPolicyExecutionContext();
@@ -43,7 +47,11 @@ public void GetPolicyExecutionContext_Null_ReturnsNull()
4347
{
4448
// Arrange
4549
var request = new HttpRequestMessage();
50+
#if USE_OBSOLETED
4651
request.Properties[HttpRequestMessageExtensions.PolicyExecutionContextKey] = null;
52+
#else
53+
request.Options.Set(new HttpRequestOptionsKey<Context>(HttpRequestMessageExtensions.PolicyExecutionContextKey), null);
54+
#endif
4755

4856
// Act
4957
var actual = request.GetPolicyExecutionContext();
@@ -63,7 +71,13 @@ public void SetPolicyExecutionContext_WithValue_SetsContext()
6371
request.SetPolicyExecutionContext(expected);
6472

6573
// Assert
74+
#if USE_OBSOLETED
6675
var actual = request.Properties[HttpRequestMessageExtensions.PolicyExecutionContextKey];
76+
#else
77+
request.Options.TryGetValue(
78+
new HttpRequestOptionsKey<Context>(HttpRequestMessageExtensions.PolicyExecutionContextKey),
79+
out Context actual);
80+
#endif
6781
Assert.Same(expected, actual);
6882
}
6983

@@ -72,13 +86,23 @@ public void SetPolicyExecutionContext_WithNull_SetsNull()
7286
{
7387
// Arrange
7488
var request = new HttpRequestMessage();
89+
#if USE_OBSOLETED
7590
request.Properties[HttpRequestMessageExtensions.PolicyExecutionContextKey] = new Context(Guid.NewGuid().ToString());
91+
#else
92+
request.Options.Set(new HttpRequestOptionsKey<Context>(HttpRequestMessageExtensions.PolicyExecutionContextKey), new Context(Guid.NewGuid().ToString()));
93+
#endif
7694

7795
// Act
7896
request.SetPolicyExecutionContext(null);
7997

8098
// Assert
99+
#if USE_OBSOLETED
81100
var actual = request.Properties[HttpRequestMessageExtensions.PolicyExecutionContextKey];
101+
#else
102+
request.Options.TryGetValue(
103+
new HttpRequestOptionsKey<Context>(HttpRequestMessageExtensions.PolicyExecutionContextKey),
104+
out Context actual);
105+
#endif
82106
Assert.Null(actual);
83107
}
84108
}

src/HttpClientFactory/Polly/test/Microsoft.Extensions.Http.Polly.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
5+
<DefineConstants Condition="'$(TargetFramework)' == 'net472'">$(DefineConstants);USE_OBSOLETED</DefineConstants>
56
</PropertyGroup>
67

78
<ItemGroup>

0 commit comments

Comments
 (0)