Skip to content

Commit

Permalink
Merge pull request #26 from NerosoftDev/refactoring/service-bus
Browse files Browse the repository at this point in the history
Refactoring/service bus
  • Loading branch information
Codespilot committed Nov 29, 2023
2 parents e780308 + de9d24b commit c67613f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Tests/Euonia.Bus.InMemory.Tests/appsettings.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"DontRunTests": false
}
4 changes: 3 additions & 1 deletion Tests/Euonia.Bus.RabbitMq.Tests/appsettings.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"DontRunTests": true
}
15 changes: 9 additions & 6 deletions Tests/Euonia.Bus.Tests.Shared/ServiceBusTests.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
using Nerosoft.Euonia.Bus.Tests.Commands;
using Microsoft.Extensions.Configuration;
using Nerosoft.Euonia.Bus.Tests.Commands;

namespace Nerosoft.Euonia.Bus.Tests;

public class ServiceBusTests
{
private readonly IBus _bus;
private readonly bool _dontRunTests;

public ServiceBusTests(IBus bus)
public ServiceBusTests(IBus bus, IConfiguration configuration)
{
_bus = bus;
_dontRunTests = configuration.GetValue<bool>("DontRunTests");
}

[Fact]
public async Task TestSendCommand_HasReponse()
{
if (Defines.DontRunTests)
if (_dontRunTests)
{
return;
}
Expand All @@ -25,7 +28,7 @@ public async Task TestSendCommand_HasReponse()
[Fact]
public async Task TestSendCommand_NoReponse()
{
if (Defines.DontRunTests)
if (_dontRunTests)
{
return;
}
Expand All @@ -36,7 +39,7 @@ public async Task TestSendCommand_NoReponse()
[Fact]
public async Task TestSendCommand_HasReponse_UseSubscribeAttribute()
{
if (Defines.DontRunTests)
if (_dontRunTests)
{
return;
}
Expand All @@ -47,7 +50,7 @@ public async Task TestSendCommand_HasReponse_UseSubscribeAttribute()
[Fact]
public async Task TestSendCommand_HasReponse_MessageHasResultInherites()
{
if (Defines.DontRunTests)
if (_dontRunTests)
{
return;
}
Expand Down

0 comments on commit c67613f

Please sign in to comment.