more logging, more readme, more refactoring

This commit is contained in:
TomPallister
2016-11-05 11:36:58 +00:00
parent 8582ba45a9
commit af506b079a
37 changed files with 415 additions and 201 deletions

View File

@ -6,8 +6,11 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Moq;
using Ocelot.Infrastructure.RequestData;
using Ocelot.Logging;
using Ocelot.QueryStrings.Middleware;
using Ocelot.Requester;
using Ocelot.Requester.Middleware;
using Ocelot.Responder;
@ -33,10 +36,11 @@ namespace Ocelot.UnitTests.Requester
_url = "http://localhost:51879";
_requester = new Mock<IHttpRequester>();
_scopedRepository = new Mock<IRequestScopedDataRepository>();
var builder = new WebHostBuilder()
.ConfigureServices(x =>
{
x.AddSingleton<IOcelotLoggerFactory, AspDotNetLoggerFactory>();
x.AddLogging();
x.AddSingleton(_requester.Object);
x.AddSingleton(_scopedRepository.Object);
})
@ -55,7 +59,7 @@ namespace Ocelot.UnitTests.Requester
}
[Fact]
public void happy_path()
public void should_call_scoped_data_repository_correctly()
{
this.Given(x => x.GivenTheRequestIs(new Ocelot.Request.Request(new HttpRequestMessage(),new CookieContainer())))
.And(x => x.GivenTheRequesterReturns(new HttpResponseMessage()))