|
7 | 7 | using Microsoft.DurableTask.Tests.Logging; |
8 | 8 | using Microsoft.DurableTask.Worker; |
9 | 9 | using Microsoft.Extensions.DependencyInjection; |
| 10 | +using Microsoft.Extensions.Options; |
10 | 11 | using Xunit.Abstractions; |
11 | 12 |
|
12 | 13 | namespace Microsoft.DurableTask.Grpc.Tests; |
@@ -44,14 +45,11 @@ public async Task ScheduleOrchesrationWithTags() |
44 | 45 | b.AddTasks(tasks => tasks.AddOrchestratorFunc(orchestratorName, ctx => Task.FromResult<object?>(null))); |
45 | 46 | }); |
46 | 47 |
|
47 | | - string instanceId = await server.Client.ScheduleNewOrchestrationInstanceAsync(orchestratorName, new StartOrchestrationOptions |
48 | | - { |
49 | | - Tags = new Dictionary<string, string>() |
50 | | - { |
51 | | - { "tag1", "value1" }, |
52 | | - { "tag2", "value2" } |
53 | | - } |
54 | | - }); |
| 48 | + // Schedule a new orchestration instance with tags |
| 49 | + var options = new StartOrchestrationOptions(); |
| 50 | + options.AddTag("tag1", "value1"); |
| 51 | + options.AddTag("tag2", "value2"); |
| 52 | + string instanceId = await server.Client.ScheduleNewOrchestrationInstanceAsync(orchestratorName, options); |
55 | 53 |
|
56 | 54 | OrchestrationMetadata metadata = await server.Client.WaitForInstanceCompletionAsync( |
57 | 55 | instanceId, this.TimeoutToken); |
@@ -202,14 +200,7 @@ public async Task SingleActivity() |
202 | 200 | .AddActivityFunc<string, string>(sayHelloActivityName, (ctx, name) => $"Hello, {name}!")); |
203 | 201 | }); |
204 | 202 |
|
205 | | - string instanceId = await server.Client.ScheduleNewOrchestrationInstanceAsync(orchestratorName, input: "World", new StartOrchestrationOptions |
206 | | - { |
207 | | - Tags = new Dictionary<string, string>() |
208 | | - { |
209 | | - { "tag1", "value1" }, |
210 | | - { "tag2", "value2" } |
211 | | - } |
212 | | - }); |
| 203 | + string instanceId = await server.Client.ScheduleNewOrchestrationInstanceAsync(orchestratorName, input: "World"); |
213 | 204 | OrchestrationMetadata metadata = await server.Client.WaitForInstanceCompletionAsync( |
214 | 205 | instanceId, getInputsAndOutputs: true, this.TimeoutToken); |
215 | 206 | Assert.NotNull(metadata); |
|
0 commit comments