Skip to content

Commit

Permalink
ensure that the test does not end just after the feature startup is d…
Browse files Browse the repository at this point in the history
…one (#7063)
  • Loading branch information
tmasternak committed Jun 12, 2024
1 parent d943c45 commit 37ad2ee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ public class When_TimeToBeReceived_has_expired : NServiceBusAcceptanceTest
[Test]
public async Task Message_should_not_be_received()
{
var start = DateTime.UtcNow;

var context = await Scenario.Define<Context>()
.WithEndpoint<Endpoint>()
.Run(TimeSpan.FromSeconds(10));
.Done(c => c.WasCalled || DateTime.UtcNow - start > TimeSpan.FromSeconds(15))
.Run();

Assert.IsFalse(context.WasCalled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ public class When_TimeToBeReceived_has_expired_convention : NServiceBusAcceptanc
[Test]
public async Task Message_should_not_be_received()
{
var start = DateTime.UtcNow;

var context = await Scenario.Define<Context>()
.WithEndpoint<Endpoint>()
.Run(TimeSpan.FromSeconds(10));
.Done(c => c.WasCalled || DateTime.UtcNow - start > TimeSpan.FromSeconds(15))
.Run();

Assert.IsFalse(context.WasCalled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ public class When_TimeToBeReceived_used_with_unobtrusive_mode : NServiceBusAccep
[Test]
public async Task Message_should_not_be_received()
{
var start = DateTime.UtcNow;

var context = await Scenario.Define<Context>()
.WithEndpoint<Endpoint>()
.Run(TimeSpan.FromSeconds(10));
.Done(c => c.WasCalled || DateTime.UtcNow - start > TimeSpan.FromSeconds(15))
.Run();

Assert.IsFalse(context.WasCalled);
}
Expand Down

0 comments on commit 37ad2ee

Please sign in to comment.