Skip to content

Commit 21f5a67

Browse files
committed
Verify custom status in a unit test
1 parent a4eee3c commit 21f5a67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/Unit/Durable/OrchestrationFailureExceptionTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ public void MessageContainsSerializedOrchestrationMessage()
3535
new CallActivityAction("activity2", "input2")
3636
}
3737
};
38-
39-
var e = new OrchestrationFailureException(actions, customStatus: null, _innerException);
38+
39+
const string CustomStatus = "my custom status";
40+
41+
var e = new OrchestrationFailureException(actions, customStatus: CustomStatus, _innerException);
4042

4143
var labelPos = e.Message.IndexOf(OrchestrationFailureException.OutOfProcDataLabel);
4244
var startPos = labelPos + OrchestrationFailureException.OutOfProcDataLabel.Length;
@@ -45,6 +47,7 @@ public void MessageContainsSerializedOrchestrationMessage()
4547
Assert.False((bool)orchestrationMessage.IsDone);
4648
Assert.Null(orchestrationMessage.Output.Value);
4749
Assert.Equal(_innerException.Message, (string)orchestrationMessage.Error);
50+
Assert.Equal(CustomStatus, (string)orchestrationMessage.CustomStatus);
4851
var deserializedActions = (IEnumerable<dynamic>)((IEnumerable<dynamic>)orchestrationMessage.Actions).Single();
4952
for (var i = 0; i < actions.Single().Count(); i++)
5053
{

0 commit comments

Comments
 (0)