Skip to content

Commit d3e72ab

Browse files
EditOf assertions
1 parent 0ad1c9a commit d3e72ab

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_reedit_solves_a_failed_msg.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
22
{
3-
using System.Collections.Generic;
43
using System.Linq;
54
using System.Threading.Tasks;
65
using AcceptanceTesting;
@@ -13,7 +12,6 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
1312
using ServiceControl.MessageFailures.Api;
1413
using JsonSerializer = System.Text.Json.JsonSerializer;
1514

16-
[Ignore("resolving tests individually")]
1715
class When_a_reedit_solves_a_failed_msg : AcceptanceTest
1816
{
1917
[Test]
@@ -58,6 +56,11 @@ public async Task Should_publish_notification()
5856
return false;
5957
}
6058

59+
if (ctx.EditedMessageEditOf1 == null)
60+
{
61+
return false;
62+
}
63+
6164
if (!ctx.SecondEdit)
6265
{
6366
var failedMessagedId = await this.GetOnlyFailedUnresolvedMessageId();
@@ -84,7 +87,7 @@ public async Task Should_publish_notification()
8487
return false;
8588
}
8689

87-
if (!ctx.EditedMessageHandled)
90+
if (!ctx.EditedMessageHandled || ctx.EditedMessageEditOf2 == null)
8891
{
8992
return false;
9093
}
@@ -132,18 +135,17 @@ public class EditMessageResolutionHandler(EditMessageResolutionContext testConte
132135
{
133136
public Task Handle(EditResolutionMessage message, IMessageHandlerContext context)
134137
{
135-
var editOf = context.MessageHeaders["ServiceControl.EditOf"];
136138
switch (message.MessageAttempt)
137139
{
138140
case 0:
139141
testContext.OriginalMessageHandled = true;
140142
throw new SimulatedException();
141143
case 1:
142-
testContext.EditedMessageEditOf1 = editOf;
144+
testContext.EditedMessageEditOf1 = context.MessageHeaders["ServiceControl.EditOf"];
143145
testContext.HasBeenEditedOnce = true;
144146
throw new SimulatedException();
145147
case 2:
146-
testContext.EditedMessageEditOf2 = editOf;
148+
testContext.EditedMessageEditOf2 = context.MessageHeaders["ServiceControl.EditOf"];
147149
testContext.EditedMessageHandled = true;
148150
return Task.CompletedTask;
149151
default:

0 commit comments

Comments
 (0)