Skip to content

Commit

Permalink
(#85) Disposing clients after test
Browse files Browse the repository at this point in the history
  • Loading branch information
par.dahlman committed May 22, 2016
1 parent 0224f26 commit 44409cb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
2 changes: 2 additions & 0 deletions test/RawRabbit.Tests/DependencyInjection/AutofacTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void Should_Be_Able_To_Resolve_IBusClient()

/* Test */
var client = container.Resolve<IBusClient>();
client.Dispose();

/* Assert */
Assert.True(true, "Could resolve");
Expand All @@ -33,6 +34,7 @@ public void Should_Be_Able_To_Resolve_BusClient_With_Advanced_Context()

/* Test */
var client = container.Resolve<IBusClient<AdvancedMessageContext>>();
client.Dispose();

/* Assert */
Assert.True(true, "Could resolve");
Expand Down
54 changes: 28 additions & 26 deletions test/RawRabbit.Tests/DependencyInjection/NinjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@

namespace RawRabbit.Tests.DependencyInjection
{
public class NinjectTests
{
[Fact]
public void Should_Be_Able_To_Resolve_IBusClient()
{
/* Setup */
var kernel = new StandardKernel();
kernel.RegisterRawRabbit("guest:guest@localhost:5672/");

/* Test */
var client = kernel.Get<IBusClient>();
public class NinjectTests
{
[Fact]
public void Should_Be_Able_To_Resolve_IBusClient()
{
/* Setup */
var kernel = new StandardKernel();
kernel.RegisterRawRabbit("guest:guest@localhost:5672/");

/* Assert */
Assert.True(true, "Could resolve");
}
/* Test */
var client = kernel.Get<IBusClient>();
client.Dispose();

[Fact]
public void Should_Be_Able_To_Resolve_BusClient_With_Advanced_Context()
{
/* Setup */
var kernel = new StandardKernel();
kernel.RegisterRawRabbit<AdvancedMessageContext>("guest:guest@localhost:5672/");
/* Assert */
Assert.True(true, "Could resolve");
}

/* Test */
var client = kernel.Get<IBusClient<AdvancedMessageContext>>();
[Fact]
public void Should_Be_Able_To_Resolve_BusClient_With_Advanced_Context()
{
/* Setup */
var kernel = new StandardKernel();
kernel.RegisterRawRabbit<AdvancedMessageContext>("guest:guest@localhost:5672/");

/* Assert */
Assert.True(true, "Could resolve");
}
}
/* Test */
var client = kernel.Get<IBusClient<AdvancedMessageContext>>();
client.Dispose();

/* Assert */
Assert.True(true, "Could resolve");
}
}
}

0 comments on commit 44409cb

Please sign in to comment.