From d3a04376b46ec0e92e28242c2862877a21750376 Mon Sep 17 00:00:00 2001 From: stevenaw Date: Fri, 10 Nov 2023 21:00:38 -0500 Subject: [PATCH] Add note about IAsyncEnumerable --- .../articles/nunit/writing-tests/attributes/testcasesource.md | 4 ++++ .../nunit/writing-tests/attributes/testfixturesource.md | 4 ++++ docs/articles/nunit/writing-tests/attributes/valuesource.md | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/articles/nunit/writing-tests/attributes/testcasesource.md b/docs/articles/nunit/writing-tests/attributes/testcasesource.md index dac2e5214..f4b0a29a5 100644 --- a/docs/articles/nunit/writing-tests/attributes/testcasesource.md +++ b/docs/articles/nunit/writing-tests/attributes/testcasesource.md @@ -31,6 +31,8 @@ It has the following characteristics: * It **must** be static. This is a change from NUnit 2.x. * It must return an `IEnumerable` or a type that implements `IEnumerable`. For fields an array is generally used. For properties and methods, you may return an array or implement your own iterator. + * Methods may also return an `IAsyncEnumerable` or a type that implements `IAsyncEnumerable`. (_NUnit 4+_) + * Methods may be async by wrapping the return type in a `Task`. (_NUnit 3.14+_) * The individual items returned by the enumerator must be compatible with the signature of the method on which the attribute appears. See the **Test Case Construction** section below for details. @@ -53,6 +55,8 @@ characteristics: * It **must** be static. This is a change from NUnit 2.x. * It must return an `IEnumerable` or a type that implements `IEnumerable`. For fields an array is generally used. For properties and methods, you may return an array or implement your own iterator. + * Methods may also return an `IAsyncEnumerable` or a type that implements `IAsyncEnumerable`. (_NUnit 4+_) + * Methods may be async by wrapping the return type in a `Task`. (_NUnit 3.14+_) * The individual items returned by the enumerator must be compatible with the signature of the method on which the attribute appears. See the **Test Case Construction** section below for details. diff --git a/docs/articles/nunit/writing-tests/attributes/testfixturesource.md b/docs/articles/nunit/writing-tests/attributes/testfixturesource.md index 162ed74a5..086e808ba 100644 --- a/docs/articles/nunit/writing-tests/attributes/testfixturesource.md +++ b/docs/articles/nunit/writing-tests/attributes/testfixturesource.md @@ -33,6 +33,8 @@ constructing the `TestFixture`. It has the following characteristics: * It **must** be static. * It must return an `IEnumerable` or a type that implements `IEnumerable`. For fields an array is generally used. For properties and methods, you may return an array or implement your own iterator. + * Methods may also return an `IAsyncEnumerable` or a type that implements `IAsyncEnumerable`. (_NUnit 4+_) + * Methods may be async by wrapping the return type in a `Task`. (_NUnit 3.14+_) * The individual items returned by the enumerator must either be object arrays or derive from the `TestFixtureParameters` class. Arguments must be consistent with the fixture constructor. @@ -66,6 +68,8 @@ characteristics: * It **must** be static. * It must return an `IEnumerable` or a type that implements `IEnumerable`. For fields an array is generally used. For properties and methods, you may return an array or implement your own iterator. + * Methods may also return an `IAsyncEnumerable` or a type that implements `IAsyncEnumerable`. (_NUnit 4+_) + * Methods may be async by wrapping the return type in a `Task`. (_NUnit 3.14+_) * The individual items returned by the enumerator must either be object arrays or derive from the `TestFixtureParameters` class. Arguments must be consistent with the fixture constructor. diff --git a/docs/articles/nunit/writing-tests/attributes/valuesource.md b/docs/articles/nunit/writing-tests/attributes/valuesource.md index a457e2305..4b3c1ee26 100644 --- a/docs/articles/nunit/writing-tests/attributes/valuesource.md +++ b/docs/articles/nunit/writing-tests/attributes/valuesource.md @@ -21,7 +21,9 @@ characteristics: * It may be a field, a non-indexed property or a method taking no arguments. * It must be a static member. -* It must return an IEnumerable or a type that implements IEnumerable. +* It must return an `IEnumerable` or a type that implements `IEnumerable`. + * Methods may also return an `IAsyncEnumerable` or a type that implements `IAsyncEnumerable`. (_NUnit 4+_) + * Methods may be async by wrapping the return type in a `Task`. (_NUnit 3.14+_) * The individual items returned from the enumerator must be compatible with the type of the parameter on which the attribute appears.