diff --git a/test/Ocelot.AcceptanceTests/Steps.cs b/test/Ocelot.AcceptanceTests/Steps.cs index 39861a140..3376ee622 100644 --- a/test/Ocelot.AcceptanceTests/Steps.cs +++ b/test/Ocelot.AcceptanceTests/Steps.cs @@ -41,6 +41,7 @@ namespace Ocelot.AcceptanceTests; public class Steps : IDisposable { protected TestServer _ocelotServer; + private IHost _realServer; protected HttpClient _ocelotClient; private HttpResponseMessage _response; private HttpContent _postContent; @@ -1298,16 +1299,15 @@ protected virtual void Dispose(bool disposing) return; } - if (disposing) - { - _ocelotClient?.Dispose(); - _ocelotServer?.Dispose(); - _ocelotHost?.Dispose(); - _realServer?.Dispose(); - DeleteOcelotConfig(); - } - - _disposedValue = true; + if (disposing) + { + _ocelotClient?.Dispose(); + _ocelotServer?.Dispose(); + _ocelotHost?.Dispose(); + _realServer?.Dispose(); + DeleteOcelotConfig(); } + + _disposedValue = true; } }