@@ -183,34 +183,6 @@ Orchestrator functions manage the execution of multiple activity functions. To t
183
183
184
184
In this section, the unit test validates the behavior of the ` HelloCities ` orchestrator function:
185
185
186
- ``` csharp
187
- [Function (nameof (HelloCitiesOrchestration ))]
188
- public static async Task < List < string >> HelloCities (
189
- [OrchestrationTrigger ] TaskOrchestrationContext context )
190
- {
191
- ILogger logger = context .CreateReplaySafeLogger (nameof (Function1 ));
192
- logger .LogInformation (" Saying hello." );
193
- var outputs = new List <string >();
194
-
195
- outputs .Add (await context .CallActivityAsync <string >(nameof (SayHello ), " Tokyo" ));
196
- outputs .Add (await context .CallActivityAsync <string >(nameof (SayHello ), " Seattle" ));
197
- outputs .Add (await context .CallActivityAsync <string >(nameof (SayHello ), " London" ));
198
-
199
- return outputs ;
200
- }
201
- ```
202
-
203
- ## Unit testing orchestrator functions
204
-
205
- Orchestrator functions manage the execution of multiple activity functions. To test an orchestrator:
206
-
207
- * Mock the ` TaskOrchestrationContext ` to control function execution
208
- * Replace ` TaskOrchestrationContext ` methods needed for orchestrator execution like ` CallActivityAsync ` with mock functions
209
- * Call the orchestrator directly with the mocked context
210
- * Verify the orchestrator result using assertions
211
-
212
- In this section, the unit test validates the behavior of the ` HelloCities ` orchestrator function:
213
-
214
186
``` csharp
215
187
[Function (nameof (HelloCitiesOrchestration ))]
216
188
public static async Task < List < string >> HelloCities (
@@ -324,7 +296,7 @@ public void SayHello_ReturnsExpectedGreeting()
324
296
```
325
297
326
298
> [ !NOTE]
327
- > Currently, loggers created via FunctionContext in trigger functions are not supported for mocking in unit tests.
299
+ > Currently, loggers created via FunctionContext in activity functions are not supported for mocking in unit tests.
328
300
329
301
## Next steps
330
302
0 commit comments