Skip to content

Commit

Permalink
updating acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Bussmann committed Sep 28, 2015
1 parent 43e9434 commit e5d875c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
using System.Transactions;
using NServiceBus.AcceptanceTesting;
using NServiceBus.AcceptanceTests.EndpointTemplates;
using NServiceBus.Config;
Expand Down Expand Up @@ -160,8 +161,14 @@ public TimeoutData Peek(string timeoutId)
public bool TryRemove(string timeoutId)
{
context.AttemptedToRemoveTimeout = true;
// delete the timeout so it won't be available on retries
originalTimeoutPersisterV2.TryRemove(timeoutId);

using (var tx = new TransactionScope(TransactionScopeOption.Suppress))
{
// delete the timeout so it won't be available on retries
originalTimeoutPersisterV2.TryRemove(timeoutId);
tx.Complete();
}

return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void Endpoint_should_not_start_and_show_warning()
.InnerException as ScenarioException;

Assert.IsFalse(context.EndpointsStarted);
StringAssert.Contains("You are using an outdated transport which can lead to message loss!", scenarioException.Message);
StringAssert.Contains("You are using an outdated transport which can lead to message loss!", scenarioException.InnerException.Message);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Endpoint_should_not_start_and_show_warning()
.InnerException as ScenarioException;

Assert.IsFalse(context.EndpointsStarted);
StringAssert.Contains("You are using an outdated timeout persistence which can lead to message loss!", scenarioException.Message);
StringAssert.Contains("You are using an outdated timeout persistence which can lead to message loss!", scenarioException.InnerException.Message);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void Endpoint_should_not_start_and_show_warning()
.InnerException as ScenarioException;

Assert.IsFalse(context.EndpointsStarted);
StringAssert.Contains("You are using an outdated timeout persistence which can lead to message loss!", scenarioException.Message);
StringAssert.Contains("You are using an outdated timeout persistence which can lead to message loss!", scenarioException.InnerException.Message);
}

public class Endpoint : EndpointConfigurationBuilder
Expand Down

0 comments on commit e5d875c

Please sign in to comment.