some tidying up and a bit of refactoring...not too happy about how the proxy is working at the moment! May need a rethink!

This commit is contained in:
TomPallister
2016-09-11 21:32:56 +01:00
parent 87702141e2
commit 72cec38c0e
16 changed files with 151 additions and 60 deletions

View File

@ -20,16 +20,19 @@ namespace Ocelot.AcceptanceTests
private TestServer _server;
private HttpClient _client;
private HttpResponseMessage _response;
private readonly string _configurationPath;
public OcelotTests()
{
_configurationPath = "./bin/Debug/netcoreapp1.0/configuration.yaml";
_fakeService = new FakeService();
}
[Fact]
public void should_return_response_404()
{
this.Given(x => x.GivenTheApiGatewayIsRunning())
this.Given(x => x.GivenThereIsAConfiguration(new Configuration()))
.And(x => x.GivenTheApiGatewayIsRunning())
.When(x => x.WhenIRequestTheUrlOnTheApiGateway("/"))
.Then(x => x.ThenTheStatusCodeShouldBe(HttpStatusCode.NotFound))
.BDDfy();
@ -72,12 +75,12 @@ namespace Ocelot.AcceptanceTests
{
var serializer = new Serializer();
if (File.Exists("./configuration.yaml"))
if (File.Exists(_configurationPath))
{
File.Delete("./configuration.yaml");
File.Delete(_configurationPath);
}
using (TextWriter writer = File.CreateText("./configuration.yaml"))
using (TextWriter writer = File.CreateText(_configurationPath))
{
serializer.Serialize(writer, configuration);
}