Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Jul 11, 2023
1 parent 5b8fa65 commit adb42c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Polly.Testing/ResilienceStrategyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace Polly.Testing;
/// </summary>
public static class ResilienceStrategyExtensions
{
private const string TelemetryResilienceStrategy = "Polly.Extensions.Telemetry.TelemetryResilienceStrategy";

/// <summary>
/// Gets the inner strategies the <paramref name="strategy"/> is composed of.
/// </summary>
Expand Down Expand Up @@ -38,11 +40,11 @@ public static InnerStrategiesDescriptor GetInnerStrategies(this ResilienceStrate

return new InnerStrategiesDescriptor(
innerStrategies.Where(s => !ShouldSkip(s.StrategyType)).ToList().AsReadOnly(),
HasTelemetry: innerStrategies.Exists(s => s.StrategyType.FullName == "Polly.Extensions.Telemetry.TelemetryResilienceStrategy"),
HasTelemetry: innerStrategies.Exists(s => s.StrategyType.FullName == TelemetryResilienceStrategy),
IsReloadable: innerStrategies.Exists(s => s.StrategyType == typeof(ReloadableResilienceStrategy)));
}

private static bool ShouldSkip(Type type) => type == typeof(ReloadableResilienceStrategy) || type.FullName == "Polly.Extensions.Telemetry.TelemetryResilienceStrategy";
private static bool ShouldSkip(Type type) => type == typeof(ReloadableResilienceStrategy) || type.FullName == TelemetryResilienceStrategy;

private static void ExpandStrategies(this ResilienceStrategy strategy, List<ResilienceStrategy> strategies)
{
Expand Down

0 comments on commit adb42c2

Please sign in to comment.