Skip to content

Commit 4c7f5c7

Browse files
committed
(#274) Add inter operation test
To catch problem with respond and publish
1 parent f4c0dbb commit 4c7f5c7

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

test/RawRabbit.Enrichers.Polly.Tests/RawRabbit.Enrichers.Polly.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
<Name>RawRabbit</Name>
9595
</ProjectReference>
9696
</ItemGroup>
97+
<ItemGroup>
98+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
99+
</ItemGroup>
97100
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
98101
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
99102
<PropertyGroup>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Threading.Tasks;
2+
using RawRabbit.Exceptions;
3+
using RawRabbit.IntegrationTests.TestMessages;
4+
using Xunit;
5+
6+
namespace RawRabbit.IntegrationTests.Compatibility
7+
{
8+
public class InteroperationFunctionalityTests
9+
{
10+
[Fact]
11+
public async Task Throws_Publish_Confirm_Exception_If_Rpc_Response_Sent()
12+
{
13+
using (var client = RawRabbitFactory.CreateTestClient())
14+
{
15+
// Setup
16+
await client.RespondAsync<BasicRequest, BasicResponse>(request => Task.FromResult(new BasicResponse()));
17+
await client.RequestAsync<BasicRequest, BasicResponse>(new BasicRequest());
18+
19+
try
20+
{
21+
// Test
22+
await client.PublishAsync(new BasicMessage());
23+
}
24+
catch (PublishConfirmException e)
25+
{
26+
// Assert
27+
Assert.True(false, e.Message);
28+
}
29+
Assert.True(true);
30+
}
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)