mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 16:18:14 +08:00
failing pesky test
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user