Skip to content

Commit

Permalink
feat: Adjust root namespace
Browse files Browse the repository at this point in the history
To avoid namespace clash (see #32) change root namespace from
Dodo.HttpClient.ResiliencePolicies to Dodo.HttpClientResiliencePolicies
  • Loading branch information
Ceridan committed Oct 17, 2020
1 parent b1ba329 commit 16aebf3
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Net;
using System.Threading.Tasks;
using Dodo.HttpClient.ResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClient.ResiliencePolicies.RetrySettings;
using Dodo.HttpClient.ResiliencePolicies.Tests.DSL;
using Dodo.HttpClientResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClientResiliencePolicies.RetrySettings;
using Dodo.HttpClientResiliencePolicies.Tests.DSL;
using NUnit.Framework;
using Polly.CircuitBreaker;

namespace Dodo.HttpClient.ResiliencePolicies.Tests
namespace Dodo.HttpClientResiliencePolicies.Tests
{
[TestFixture]
public class CircuitBreakerTests
Expand Down
2 changes: 1 addition & 1 deletion src/Dodo.HttpClient.ResiliencePolicies.Tests/DSL/Create.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Dodo.HttpClient.ResiliencePolicies.Tests.DSL
namespace Dodo.HttpClientResiliencePolicies.Tests.DSL
{
public static class Create
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Dodo.HttpClient.ResiliencePolicies.Tests.Fakes;
using System.Net.Http;
using Dodo.HttpClientResiliencePolicies.Tests.Fakes;

namespace Dodo.HttpClient.ResiliencePolicies.Tests.DSL
namespace Dodo.HttpClientResiliencePolicies.Tests.DSL
{
using HttpClient = System.Net.Http.HttpClient;

public class HttpClientWrapper
{
private readonly HttpClient _client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using Dodo.HttpClient.ResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClient.ResiliencePolicies.RetrySettings;
using Dodo.HttpClient.ResiliencePolicies.Tests.Fakes;
using Dodo.HttpClientResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClientResiliencePolicies.RetrySettings;
using Dodo.HttpClientResiliencePolicies.Tests.Fakes;
using Microsoft.Extensions.DependencyInjection;

namespace Dodo.HttpClient.ResiliencePolicies.Tests.DSL
namespace Dodo.HttpClientResiliencePolicies.Tests.DSL
{
public sealed class HttpClientWrapperBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework Condition="'$(Framework)' == 'netcoreapp2.1'">netcoreapp2.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
<RootNamespace>Dodo.HttpClientResiliencePolicies.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Dodo.HttpClient.ResiliencePolicies.Tests.Fakes
namespace Dodo.HttpClientResiliencePolicies.Tests.Fakes
{
public class MockHttpMessageHandler : HttpMessageHandler
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Dodo.HttpClient.ResiliencePolicies.Tests.Fakes
namespace Dodo.HttpClientResiliencePolicies.Tests.Fakes
{
public interface IMockJsonClient
{ }
Expand Down
4 changes: 2 additions & 2 deletions src/Dodo.HttpClient.ResiliencePolicies.Tests/Helper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Net.Http;
using System.Threading.Tasks;

namespace Dodo.HttpClient.ResiliencePolicies.Tests
namespace Dodo.HttpClientResiliencePolicies.Tests
{
using HttpClient = System.Net.Http.HttpClient;
using HttpClient = HttpClient;

public static class Helper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using Dodo.HttpClient.ResiliencePolicies.Tests.Fakes;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Dodo.HttpClientResiliencePolicies.Tests.Fakes;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;

namespace Dodo.HttpClient.ResiliencePolicies.Tests
namespace Dodo.HttpClientResiliencePolicies.Tests
{
[TestFixture]
public class HttpClientBuilderExtensionsTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Dodo.HttpClient.ResiliencePolicies.RetrySettings;
using Dodo.HttpClient.ResiliencePolicies.Tests.DSL;
using Dodo.HttpClientResiliencePolicies.RetrySettings;
using Dodo.HttpClientResiliencePolicies.Tests.DSL;
using NUnit.Framework;
using Polly;

namespace Dodo.HttpClient.ResiliencePolicies.Tests
namespace Dodo.HttpClientResiliencePolicies.Tests
{
[TestFixture]
public class RetryPolicyTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Net;
using System.Threading.Tasks;
using Dodo.HttpClient.ResiliencePolicies.RetrySettings;
using Dodo.HttpClient.ResiliencePolicies.Tests.DSL;
using Dodo.HttpClientResiliencePolicies.RetrySettings;
using Dodo.HttpClientResiliencePolicies.Tests.DSL;
using NUnit.Framework;
using Polly.Timeout;

namespace Dodo.HttpClient.ResiliencePolicies.Tests
namespace Dodo.HttpClientResiliencePolicies.Tests
{
[TestFixture]
public class TimeoutPolicyTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Net.Http;
using Polly;

namespace Dodo.HttpClient.ResiliencePolicies.CircuitBreakerSettings
namespace Dodo.HttpClientResiliencePolicies.CircuitBreakerSettings
{
public class CircuitBreakerSettings : ICircuitBreakerSettings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Net.Http;
using Polly;

namespace Dodo.HttpClient.ResiliencePolicies.CircuitBreakerSettings
namespace Dodo.HttpClientResiliencePolicies.CircuitBreakerSettings
{
public interface ICircuitBreakerSettings
{
Expand Down
2 changes: 1 addition & 1 deletion src/Dodo.HttpClient.ResiliencePolicies/Defaults.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Dodo.HttpClient.ResiliencePolicies
namespace Dodo.HttpClientResiliencePolicies
{
public static class Defaults
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<TargetFrameworks Condition="'$(Framework)' != 'netcoreapp2.1'">netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFramework Condition="'$(Framework)' == 'netcoreapp2.1'">netstandard2.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<VersionPrefix>1.0.3</VersionPrefix>
<VersionPrefix>2.0.0</VersionPrefix>
<RootNamespace>Dodo.HttpClientResiliencePolicies</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using Dodo.HttpClient.ResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClient.ResiliencePolicies.RetrySettings;
using Dodo.HttpClientResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClientResiliencePolicies.RetrySettings;
using Microsoft.Extensions.DependencyInjection;
using Polly;
using Polly.CircuitBreaker;
using Polly.Extensions.Http;
using Polly.Registry;
using Polly.Timeout;

namespace Dodo.HttpClient.ResiliencePolicies
namespace Dodo.HttpClientResiliencePolicies
{
/// <summary>
/// Extension methods for configuring <see cref="IHttpClientBuilder"/> with Polly retry, timeout, circuit breaker policies.
Expand All @@ -30,7 +30,7 @@ public static IHttpClientBuilder AddJsonClient<TClientInterface, TClientImplemen
string clientName = null) where TClientInterface : class
where TClientImplementation : class, TClientInterface
{
Action<System.Net.Http.HttpClient> defaultClient = (client) =>
Action<HttpClient> defaultClient = (client) =>
{
client.BaseAddress = baseAddress;
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Expand Down
10 changes: 5 additions & 5 deletions src/Dodo.HttpClient.ResiliencePolicies/HttpClientSettings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using Dodo.HttpClient.ResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClient.ResiliencePolicies.RetrySettings;
using Dodo.HttpClientResiliencePolicies.CircuitBreakerSettings;
using Dodo.HttpClientResiliencePolicies.RetrySettings;

namespace Dodo.HttpClient.ResiliencePolicies
namespace Dodo.HttpClientResiliencePolicies
{
public class HttpClientSettings
{
Expand All @@ -17,7 +17,7 @@ public HttpClientSettings(
TimeSpan timeoutPerTry,
int retryCount) : this(httpClientTimeout, timeoutPerTry,
new JitterRetrySettings(retryCount),
ResiliencePolicies.CircuitBreakerSettings.CircuitBreakerSettings.Default())
HttpClientResiliencePolicies.CircuitBreakerSettings.CircuitBreakerSettings.Default())
{
}

Expand Down Expand Up @@ -46,7 +46,7 @@ public HttpClientSettings(
public static HttpClientSettings Default() =>
new HttpClientSettings(
JitterRetrySettings.Default(),
ResiliencePolicies.CircuitBreakerSettings.CircuitBreakerSettings.Default()
HttpClientResiliencePolicies.CircuitBreakerSettings.CircuitBreakerSettings.Default()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Net.Http;
using Polly;

namespace Dodo.HttpClient.ResiliencePolicies.RetrySettings
namespace Dodo.HttpClientResiliencePolicies.RetrySettings
{
public interface IRetrySettings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Polly;
using Polly.Contrib.WaitAndRetry;

namespace Dodo.HttpClient.ResiliencePolicies.RetrySettings
namespace Dodo.HttpClientResiliencePolicies.RetrySettings
{
public class JitterRetrySettings : IRetrySettings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Net.Http;
using Polly;

namespace Dodo.HttpClient.ResiliencePolicies.RetrySettings
namespace Dodo.HttpClientResiliencePolicies.RetrySettings
{
public class SimpleRetrySettings : IRetrySettings
{
Expand Down

0 comments on commit 16aebf3

Please sign in to comment.