failing pesky test

This commit is contained in:
TomPallister
2016-09-14 21:18:25 +01:00
parent 0627e9399b
commit f3128cffe0
5 changed files with 203 additions and 6 deletions

View File

@ -21,6 +21,7 @@ namespace Ocelot.AcceptanceTests
private HttpClient _client;
private HttpResponseMessage _response;
private readonly string _configurationPath;
private string _postContent;
public OcelotTests()
{
@ -76,11 +77,17 @@ namespace Ocelot.AcceptanceTests
}
}))
.And(x => x.GivenTheApiGatewayIsRunning())
.And(x => x.GivenThePostHasContent("postContent"))
.When(x => x.WhenIPostUrlOnTheApiGateway("/"))
.Then(x => x.ThenTheStatusCodeShouldBe(HttpStatusCode.Created))
.BDDfy();
}
private void GivenThePostHasContent(string postcontent)
{
_postContent = postcontent;
}
/// <summary>
/// This is annoying cos it should be in the constructor but we need to set up the yaml file before calling startup so its a step.
/// </summary>
@ -119,7 +126,8 @@ namespace Ocelot.AcceptanceTests
private void WhenIPostUrlOnTheApiGateway(string url)
{
_response = _client.PostAsync(url, new StringContent(string.Empty)).Result;
var content = new StringContent(_postContent);
_response = _client.PostAsync(url, content).Result;
}
private void ThenTheStatusCodeShouldBe(HttpStatusCode expectedHttpStatusCode)