Skip to content

Commit

Permalink
(#274) Add inter operation test
Browse files Browse the repository at this point in the history
To catch problem with respond and publish
  • Loading branch information
pardahlman committed Oct 9, 2017
1 parent f4c0dbb commit 4c7f5c7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
<Name>RawRabbit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
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);
}
}
}
}

0 comments on commit 4c7f5c7

Please sign in to comment.