Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Add the helper method for C# (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-acm authored Jun 2, 2022
1 parent e017390 commit 7e2aed6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions themes/default/content/docs/guides/testing/unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,17 @@ public async Task InstanceHasNameTag()
tags.Should().NotBeNull("Tags are not defined");
tags.Should().ContainKey("Name");
}

public static Task<T> GetValueAsync<T>(this Output<T> output)
{
var tcs = new TaskCompletionSource<T>();
output.Apply(v =>
{
tcs.SetResult(v);
return v;
});
return tcs.Task;
}
```

{{% /choosable %}}
Expand Down

0 comments on commit 7e2aed6

Please sign in to comment.