Skip to content

Commit

Permalink
#349 default to no load balancer so that in load balaner house we don…
Browse files Browse the repository at this point in the history
…t always rebuild the loadbalancer infrastructure because the load balancer options type is null (#358)
  • Loading branch information
TomPallister authored May 15, 2018
1 parent 1e2e953 commit 061a90f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Ocelot/Configuration/LoadBalancerOptions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Ocelot.LoadBalancer.LoadBalancers;

namespace Ocelot.Configuration
{
public class LoadBalancerOptions
{
public LoadBalancerOptions(string type, string key, int expiryInMs)
{
Type = type;
Type = type ?? nameof(NoLoadBalancer);
Key = key;
ExpiryInMs = expiryInMs;
}
Expand Down
17 changes: 17 additions & 0 deletions test/Ocelot.UnitTests/LoadBalancer/LoadBalancerOptionsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Ocelot.Configuration;
using Ocelot.LoadBalancer.LoadBalancers;
using Shouldly;
using Xunit;

namespace Ocelot.UnitTests.LoadBalancer
{
public class LoadBalancerOptionsTests
{
[Fact]
public void should_default_to_no_load_balancer()
{
var options = new LoadBalancerOptionsBuilder().Build();
options.Type.ShouldBe(nameof(NoLoadBalancer));
}
}
}

0 comments on commit 061a90f

Please sign in to comment.