Skip to content

Commit

Permalink
reorder members
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroservienti committed Jun 1, 2020
1 parent d7e2b21 commit 0ecada4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/NServiceBus.IntegrationTesting/IntegrationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ namespace NServiceBus.IntegrationTesting
{
public class IntegrationContext : ScenarioContext
{
ConcurrentBag<HandlerInvocation> invokedHandlers = new ConcurrentBag<HandlerInvocation>();
readonly ConcurrentBag<HandlerInvocation> invokedHandlers = new ConcurrentBag<HandlerInvocation>();
readonly ConcurrentBag<SagaInvocation> invokedSagas = new ConcurrentBag<SagaInvocation>();

public IEnumerable<HandlerInvocation> InvokedHandlers { get { return invokedHandlers; } }
public IEnumerable<SagaInvocation> InvokedSagas { get { return invokedSagas; } }

internal HandlerInvocation CaptureInvokedHandler(HandlerInvocation invocation)
{
Expand All @@ -19,19 +21,14 @@ internal HandlerInvocation CaptureInvokedHandler(HandlerInvocation invocation)
return invocation;
}

ConcurrentBag<SagaInvocation> invokedSagas = new ConcurrentBag<SagaInvocation>();

public IEnumerable<SagaInvocation> InvokedSagas { get { return invokedSagas; } }


internal SagaInvocation CaptureInvokedSaga(SagaInvocation invocation)
{
invokedSagas.Add(invocation);

return invocation;
}

static PropertyInfo GetCurrentProperty()
static PropertyInfo GetScenarioContextCurrentProperty()
{
return typeof(ScenarioContext).GetProperty("Current", BindingFlags.Static | BindingFlags.NonPublic);
}
Expand All @@ -40,7 +37,7 @@ public static IntegrationContext CurrentContext
{
get
{
var pi = GetCurrentProperty();
var pi = GetScenarioContextCurrentProperty();
var current = (IntegrationContext)pi.GetMethod.Invoke(null, null);

return current;
Expand Down

0 comments on commit 0ecada4

Please sign in to comment.