Upgrade Projects (#900)

* Upgrade Projects

* Push to trigger builds

* Tried Thread Sleep before deleting file

* FileDeleteTryCatch

* Updated from AspnetCore All to App

* Travis version Upgrade (.net core 2.2)

* dotnet 2.2.105
This commit is contained in:
Thiago Loureiro
2019-05-24 10:06:16 +08:00
committed by GitHub
parent 5b02fb7fe7
commit fe3cf44c45
46 changed files with 270 additions and 226 deletions

View File

@ -141,7 +141,6 @@
await _ocelotHost.StartAsync();
}
public void GivenThereIsAConfiguration(FileConfiguration fileConfiguration)
{
var configurationPath = TestConfiguration.ConfigurationPath;
@ -150,7 +149,14 @@
if (File.Exists(configurationPath))
{
File.Delete(configurationPath);
try
{
File.Delete(configurationPath);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
File.WriteAllText(configurationPath, jsonConfiguration);
@ -162,7 +168,14 @@
if (File.Exists(configurationPath))
{
File.Delete(configurationPath);
try
{
File.Delete(configurationPath);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
File.WriteAllText(configurationPath, jsonConfiguration);
@ -190,7 +203,7 @@
})
.ConfigureServices(s =>
{
s.AddOcelot();
s.AddOcelot();
})
.Configure(app =>
{
@ -261,7 +274,6 @@
_ocelotClient = _ocelotServer.CreateClient();
}
public void ThenTheTraceHeaderIsSet(string key)
{
var header = _response.Headers.GetValues(key);
@ -306,7 +318,6 @@
_ocelotClient = _ocelotServer.CreateClient();
}
public void GivenOcelotIsRunningUsingConsulToStoreConfigAndJsonSerializedCache()
{
_webHostBuilder = new WebHostBuilder();
@ -339,7 +350,7 @@
.Configure(app =>
{
app.UseOcelot().Wait();
});
});
_ocelotServer = new TestServer(_webHostBuilder);
@ -376,7 +387,8 @@
public void WhenIGetUrlOnTheApiGatewayWaitingForTheResponseToBeOk(string url)
{
var result = Wait.WaitFor(2000).Until(() => {
var result = Wait.WaitFor(2000).Until(() =>
{
try
{
_response = _ocelotClient.GetAsync(url).Result;
@ -392,7 +404,6 @@
result.ShouldBeTrue();
}
public void GivenOcelotIsRunningUsingJsonSerializedCache()
{
_webHostBuilder = new WebHostBuilder();
@ -423,7 +434,7 @@
.Configure(app =>
{
app.UseOcelot().Wait();
});
});
_ocelotServer = new TestServer(_webHostBuilder);
@ -559,7 +570,7 @@
_ocelotClient = _ocelotServer.CreateClient();
}
public void GivenOcelotIsRunningWithGlobalHandlersRegisteredInDi<TOne, TWo>()
public void GivenOcelotIsRunningWithGlobalHandlersRegisteredInDi<TOne, TWo>()
where TOne : DelegatingHandler
where TWo : DelegatingHandler
{
@ -592,7 +603,7 @@
_ocelotClient = _ocelotServer.CreateClient();
}
public void GivenOcelotIsRunningWithGlobalHandlerRegisteredInDi<TOne>()
public void GivenOcelotIsRunningWithGlobalHandlerRegisteredInDi<TOne>()
where TOne : DelegatingHandler
{
_webHostBuilder = new WebHostBuilder();
@ -623,7 +634,7 @@
_ocelotClient = _ocelotServer.CreateClient();
}
public void GivenOcelotIsRunningWithGlobalHandlersRegisteredInDi<TOne>(FakeDependency dependency)
public void GivenOcelotIsRunningWithGlobalHandlersRegisteredInDi<TOne>(FakeDependency dependency)
where TOne : DelegatingHandler
{
_webHostBuilder = new WebHostBuilder();
@ -884,8 +895,6 @@
_ocelotClient = _ocelotServer.CreateClient();
}
public void WhenIGetUrlOnTheApiGateway(string url)
{
_response = _ocelotClient.GetAsync(url).Result;
@ -1004,7 +1013,7 @@
{
_response.Content.ReadAsStringAsync().Result.ShouldBe(expectedBody);
}
public void ThenTheContentLengthIs(int expected)
{
_response.Content.Headers.ContentLength.ShouldBe(expected);
@ -1111,7 +1120,6 @@
_ocelotServer = new TestServer(_webHostBuilder);
_ocelotClient = _ocelotServer.CreateClient();
}
}
}