Added first authentiction code..we have a test that makes sure we are unauthenticed but i havent been able to get authenticated to work yet due to identity server usual madness when calling with their SDK!

This commit is contained in:
TomPallister
2016-10-15 11:17:18 +01:00
parent 67af8841b2
commit 34bac7e0d4
50 changed files with 545 additions and 144 deletions

View File

@@ -6,10 +6,10 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using Moq;
using Ocelot.Library.Infrastructure.Middleware;
using Ocelot.Library.Infrastructure.Repository;
using Ocelot.Library.Infrastructure.Responder;
using Ocelot.Library.Infrastructure.Responses;
using Ocelot.Library.Middleware;
using TestStack.BDDfy;
using Xunit;
@@ -19,6 +19,7 @@ namespace Ocelot.UnitTests.Middleware
{
private readonly Mock<IHttpResponder> _responder;
private readonly Mock<IScopedRequestDataRepository> _scopedRepository;
private readonly Mock<IErrorsToHttpStatusCodeMapper> _codeMapper;
private readonly string _url;
private readonly TestServer _server;
private readonly HttpClient _client;
@@ -30,10 +31,12 @@ namespace Ocelot.UnitTests.Middleware
_url = "http://localhost:51879";
_responder = new Mock<IHttpResponder>();
_scopedRepository = new Mock<IScopedRequestDataRepository>();
_codeMapper = new Mock<IErrorsToHttpStatusCodeMapper>();
var builder = new WebHostBuilder()
.ConfigureServices(x =>
{
x.AddSingleton(_codeMapper.Object);
x.AddSingleton(_responder.Object);
x.AddSingleton(_scopedRepository.Object);
})