Skip to content

Commit

Permalink
Expose http listener disposable
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Morris-Hill committed Jul 3, 2024
1 parent b693b1c commit 717281b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion FluentSim/FluentSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace FluentSim
{
public class FluentSimulator
public class FluentSimulator : IDisposable
{
private string Address;
private List<FluentConfigurator> ConfiguredRoutes = new List<FluentConfigurator>();
Expand Down Expand Up @@ -198,5 +198,10 @@ public void EnableCors()
{
CorsEnabled = true;
}

public void Dispose()
{
((IDisposable) HttpListener)?.Dispose();
}
}
}
1 change: 1 addition & 0 deletions FluentSimTests/FluentSimTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void SetUp()
public void TearDown()
{
Sim.Stop();
Sim.Dispose();
}

[Test]
Expand Down

0 comments on commit 717281b

Please sign in to comment.