-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To catch problem with respond and publish
- Loading branch information
1 parent
f4c0dbb
commit 4c7f5c7
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/RawRabbit.IntegrationTests/Compatibility/InteroperationFunctionalityTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Threading.Tasks; | ||
using RawRabbit.Exceptions; | ||
using RawRabbit.IntegrationTests.TestMessages; | ||
using Xunit; | ||
|
||
namespace RawRabbit.IntegrationTests.Compatibility | ||
{ | ||
public class InteroperationFunctionalityTests | ||
{ | ||
[Fact] | ||
public async Task Throws_Publish_Confirm_Exception_If_Rpc_Response_Sent() | ||
{ | ||
using (var client = RawRabbitFactory.CreateTestClient()) | ||
{ | ||
// Setup | ||
await client.RespondAsync<BasicRequest, BasicResponse>(request => Task.FromResult(new BasicResponse())); | ||
await client.RequestAsync<BasicRequest, BasicResponse>(new BasicRequest()); | ||
|
||
try | ||
{ | ||
// Test | ||
await client.PublishAsync(new BasicMessage()); | ||
} | ||
catch (PublishConfirmException e) | ||
{ | ||
// Assert | ||
Assert.True(false, e.Message); | ||
} | ||
Assert.True(true); | ||
} | ||
} | ||
} | ||
} |