diff --git a/Tests/Euonia.Bus.InMemory.Tests/Defines.cs b/Tests/Euonia.Bus.InMemory.Tests/Defines.cs new file mode 100644 index 0000000..20c8292 --- /dev/null +++ b/Tests/Euonia.Bus.InMemory.Tests/Defines.cs @@ -0,0 +1,7 @@ +namespace Nerosoft.Euonia.Bus.Tests; + +internal partial class Defines +{ + public const bool DontRunTests = false; + +} diff --git a/Tests/Euonia.Bus.RabbitMq.Tests/Defines.cs b/Tests/Euonia.Bus.RabbitMq.Tests/Defines.cs new file mode 100644 index 0000000..f69f38c --- /dev/null +++ b/Tests/Euonia.Bus.RabbitMq.Tests/Defines.cs @@ -0,0 +1,13 @@ +namespace Nerosoft.Euonia.Bus.Tests; + +internal partial class Defines +{ + public const bool DontRunTests = +#if DEBUG + false +#else + true +#endif + ; + +} diff --git a/Tests/Euonia.Bus.Tests.Shared/Defines.cs b/Tests/Euonia.Bus.Tests.Shared/Defines.cs new file mode 100644 index 0000000..f4f49a6 --- /dev/null +++ b/Tests/Euonia.Bus.Tests.Shared/Defines.cs @@ -0,0 +1,6 @@ +namespace Nerosoft.Euonia.Bus.Tests; + +internal partial class Defines +{ + +} \ No newline at end of file diff --git a/Tests/Euonia.Bus.Tests.Shared/Euonia.Bus.Tests.Shared.projitems b/Tests/Euonia.Bus.Tests.Shared/Euonia.Bus.Tests.Shared.projitems index 485842f..413a03d 100644 --- a/Tests/Euonia.Bus.Tests.Shared/Euonia.Bus.Tests.Shared.projitems +++ b/Tests/Euonia.Bus.Tests.Shared/Euonia.Bus.Tests.Shared.projitems @@ -12,6 +12,7 @@ + diff --git a/Tests/Euonia.Bus.Tests.Shared/ServiceBusTests.cs b/Tests/Euonia.Bus.Tests.Shared/ServiceBusTests.cs index 6ff5436..0e141b7 100644 --- a/Tests/Euonia.Bus.Tests.Shared/ServiceBusTests.cs +++ b/Tests/Euonia.Bus.Tests.Shared/ServiceBusTests.cs @@ -14,6 +14,10 @@ public ServiceBusTests(IBus bus) [Fact] public async Task TestSendCommand_HasReponse() { + if (Defines.DontRunTests) + { + return; + } var result = await _bus.SendAsync(new UserCreateCommand()); Assert.Equal(1, result); } @@ -21,6 +25,10 @@ public async Task TestSendCommand_HasReponse() [Fact] public async Task TestSendCommand_NoReponse() { + if (Defines.DontRunTests) + { + return; + } await _bus.SendAsync(new UserCreateCommand()); Assert.True(true); } @@ -28,6 +36,10 @@ public async Task TestSendCommand_NoReponse() [Fact] public async Task TestSendCommand_HasReponse_UseSubscribeAttribute() { + if (Defines.DontRunTests) + { + return; + } var result = await _bus.SendAsync(new FooCreateCommand(), new SendOptions { Channel = "foo.create" }); Assert.Equal(1, result); } @@ -35,6 +47,10 @@ public async Task TestSendCommand_HasReponse_UseSubscribeAttribute() [Fact] public async Task TestSendCommand_HasReponse_MessageHasResultInherites() { + if (Defines.DontRunTests) + { + return; + } var result = await _bus.SendAsync(new FooCreateCommand(), new SendOptions { Channel = "foo.create" }); Assert.Equal(1, result); }