generated from mauroservienti/code-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe3b317
commit 6973b06
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/NServiceBus.IntegrationTesting.Tests/Publish_Operation_Interceptor.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,31 @@ | ||
using MyMessages.Messages; | ||
using NServiceBus.Pipeline; | ||
using NServiceBus.Testing; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace NServiceBus.IntegrationTesting.Tests | ||
{ | ||
public class Publish_Operation_Interceptor | ||
{ | ||
[Test] | ||
public async Task Should_Capture_Publish_Message_Operation() | ||
{ | ||
var scenarioContext = new IntegrationScenarioContext(); | ||
var context = new TestableOutgoingPublishContext | ||
{ | ||
Message = new OutgoingLogicalMessage(typeof(AMessage), new AMessage()) | ||
}; | ||
|
||
var sut = new InterceptPublishOperations("fake-endpoint", scenarioContext); | ||
await sut.Invoke(context, () => Task.CompletedTask).ConfigureAwait(false); | ||
|
||
var operation = scenarioContext.OutgoingMessageOperations.SingleOrDefault() as PublishOperation; | ||
|
||
Assert.AreEqual(1, scenarioContext.OutgoingMessageOperations.Count()); | ||
Assert.IsNotNull(operation); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/NServiceBus.IntegrationTesting.Tests/Reply_Operation_Interceptor.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,31 @@ | ||
using MyMessages.Messages; | ||
using NServiceBus.Pipeline; | ||
using NServiceBus.Testing; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace NServiceBus.IntegrationTesting.Tests | ||
{ | ||
public class Reply_Operation_Interceptor | ||
{ | ||
[Test] | ||
public async Task Should_Capture_Reply_Message_Operation() | ||
{ | ||
var scenarioContext = new IntegrationScenarioContext(); | ||
var context = new TestableOutgoingReplyContext | ||
{ | ||
Message = new OutgoingLogicalMessage(typeof(AMessage), new AMessage()) | ||
}; | ||
|
||
var sut = new InterceptReplyOperations("fake-endpoint", scenarioContext); | ||
await sut.Invoke(context, () => Task.CompletedTask).ConfigureAwait(false); | ||
|
||
var operation = scenarioContext.OutgoingMessageOperations.SingleOrDefault() as ReplyOperation; | ||
|
||
Assert.AreEqual(1, scenarioContext.OutgoingMessageOperations.Count()); | ||
Assert.IsNotNull(operation); | ||
} | ||
} | ||
} |