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