more auth stuff...nowhere near done

This commit is contained in:
TomPallister
2016-10-18 22:19:41 +01:00
parent 0221ee9ccb
commit 3285be3c73
21 changed files with 543 additions and 21 deletions

View File

@@ -57,11 +57,20 @@ namespace Ocelot.UnitTests.Authorization
public void happy_path()
{
this.Given(x => x.GivenTheDownStreamRouteIs(new DownstreamRoute(new List<TemplateVariableNameAndValue>(), new ReRouteBuilder().Build())))
.And(x => x.GivenTheAuthServiceReturns(new OkResponse<bool>(true)))
.When(x => x.WhenICallTheMiddleware())
.Then(x => x.ThenTheAuthServiceIsCalledCorrectly())
//todo stick this back in
//.Then(x => x.ThenTheAuthServiceIsCalledCorrectly())
.BDDfy();
}
private void GivenTheAuthServiceReturns(Response<bool> expected)
{
_authService
.Setup(x => x.Authorise(It.IsAny<ClaimsPrincipal>(), It.IsAny<RouteClaimsRequirement>()))
.Returns(expected);
}
private void ThenTheAuthServiceIsCalledCorrectly()
{
_authService