more messing with send ot self

This commit is contained in:
Tom Gardham-Pallister
2018-05-05 12:53:19 +01:00
parent 17a515c4c0
commit c041d90e38
7 changed files with 99 additions and 36 deletions

View File

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using Ocelot.Infrastructure;
using Shouldly;
using Xunit;

View File

@ -14,6 +14,7 @@ namespace Ocelot.UnitTests.LoadBalancer
using Ocelot.Middleware;
using Ocelot.UnitTests.Responder;
using TestStack.BDDfy;
using Ocelot.Infrastructure;
public class CookieStickySessionsTests
{
@ -24,12 +25,14 @@ namespace Ocelot.UnitTests.LoadBalancer
private Response<ServiceHostAndPort> _result;
private Response<ServiceHostAndPort> _firstHostAndPort;
private Response<ServiceHostAndPort> _secondHostAndPort;
private IBus<StickySession> _bus;
public CookieStickySessionsTests()
{
_bus = new InMemoryBus<StickySession>();
_loadBalancer = new Mock<ILoadBalancer>();
_defaultExpiryInMs = 100;
_stickySessions = new CookieStickySessions(_loadBalancer.Object, "sessionid", _defaultExpiryInMs);
_stickySessions = new CookieStickySessions(_loadBalancer.Object, "sessionid", _defaultExpiryInMs, _bus);
_downstreamContext = new DownstreamContext(new DefaultHttpContext());
}