|
| 1 | +// Copyright (c) Microsoft Corporation. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +namespace Microsoft.DurableTask.Tests; |
| 5 | + |
| 6 | +public class TaskOptionsTests |
| 7 | +{ |
| 8 | + [Fact] |
| 9 | + public void Empty_Ctors_Okay() |
| 10 | + { |
| 11 | + TaskOptions options = new(); |
| 12 | + options.Retry.Should().BeNull(); |
| 13 | + options.Tags.Should().BeNull(); |
| 14 | + |
| 15 | + SubOrchestrationOptions subOptions = new(); |
| 16 | + subOptions.Retry.Should().BeNull(); |
| 17 | + subOptions.Tags.Should().BeNull(); |
| 18 | + subOptions.InstanceId.Should().BeNull(); |
| 19 | + |
| 20 | + StartOrchestrationOptions startOptions = new(); |
| 21 | + startOptions.Version.Should().BeNull(); |
| 22 | + startOptions.InstanceId.Should().BeNull(); |
| 23 | + startOptions.StartAt.Should().BeNull(); |
| 24 | + startOptions.Tags.Should().BeEmpty(); |
| 25 | + } |
| 26 | + |
| 27 | + [Fact] |
| 28 | + public void SubOrchestrationOptions_InstanceId_Overriden() |
| 29 | + { |
| 30 | + string instanceId = Guid.NewGuid().ToString(); |
| 31 | + SubOrchestrationOptions subOptions = new(new TaskOptions(), instanceId); |
| 32 | + subOptions.Retry.Should().BeNull(); |
| 33 | + subOptions.Tags.Should().BeNull(); |
| 34 | + subOptions.InstanceId.Should().BeNull(); |
| 35 | + |
| 36 | + StartOrchestrationOptions startOptions = new(); |
| 37 | + startOptions.Version.Should().BeNull(); |
| 38 | + startOptions.InstanceId.Should().BeNull(); |
| 39 | + startOptions.StartAt.Should().BeNull(); |
| 40 | + startOptions.Tags.Should().BeEmpty(); |
| 41 | + } |
| 42 | +} |
0 commit comments