You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following class, the Then method (ThenTheMessageShouldBeRetrievedFromTheContext()) runs first instead of the Given method (GivenTheContextIsValid()) (please ignore dumb debugging code in place only for breakpoints ;) ):
public class ShouldLogMessageBodyOnPreReceive
{
private Core.Observers.ReceiveObserver sut;
private Mock<ILogger> mockLog;
private Mock<ReceiveContext> context;
public ShouldLogMessageBodyOnPreReceive()
{
sut = new Core.Observers.ReceiveObserver();
mockLog = new Mock<ILogger>();
Core.Observers.ReceiveObserver.Log = mockLog.Object;
}
void GivenTheContextIsValid()
{
int x = 1;
}
void WhenTheMethodIsInvoked()
{
int x = 1;
}
void ThenTheMessageShouldBeRetrievedFromTheContext()
{
int x = 0;
}
void AndTheMessageShouldBeLogged()
{
int x = 0;
}
}
Renaming the then method from ThenTheMessageShouldBeRetrievedFromTheContext to ThenWeShouldGetTheMessageBody corrects the issue and the methods run in the correct order:
public class ShouldLogMessageBodyOnPreReceive
{
private Core.Observers.ReceiveObserver sut;
private Mock<ILogger> mockLog;
private Mock<ReceiveContext> context;
public ShouldLogMessageBodyOnPreReceive()
{
sut = new Core.Observers.ReceiveObserver();
mockLog = new Mock<ILogger>();
Core.Observers.ReceiveObserver.Log = mockLog.Object;
}
void GivenTheContextIsValid()
{
int x = 1;
}
void WhenTheMethodIsInvoked()
{
int x = 1;
}
void ThenWeShouldGetTheMessageBody()
{
int x = 0;
}
void AndTheMessageShouldBeLogged()
{
int x = 0;
}
}
The text was updated successfully, but these errors were encountered:
In the following class, the Then method (ThenTheMessageShouldBeRetrievedFromTheContext()) runs first instead of the Given method (GivenTheContextIsValid()) (please ignore dumb debugging code in place only for breakpoints ;) ):
Renaming the then method from ThenTheMessageShouldBeRetrievedFromTheContext to ThenWeShouldGetTheMessageBody corrects the issue and the methods run in the correct order:
The text was updated successfully, but these errors were encountered: