@@ -13,7 +13,7 @@ The package targets `netstandard2.0` and is designed to support the following ru
1313 * ` uap10 `
1414
1515
16- ** API count: 657 ** <!-- singleLineInclude: apiCount. path: /apiCount.include.md -->
16+ ** API count: 646 ** <!-- singleLineInclude: apiCount. path: /apiCount.include.md -->
1717
1818
1919** See [ Milestones] ( ../../milestones?state=closed ) for release notes.**
@@ -96,14 +96,14 @@ Reference: [Module Initializers](https://learn.microsoft.com/en-us/dotnet/csharp
9696static bool InitCalled ;
9797
9898[Test ]
99- public void ModuleInitTest () =>
100- Assert .True (InitCalled );
99+ public async Task ModuleInitTest () =>
100+ await Assert .That (InitCalled ). IsTrue ( );
101101
102102[ModuleInitializer ]
103103public static void ModuleInit () =>
104104 InitCalled = true ;
105105```
106- <sup ><a href =' /src/Tests/ModuleInitSample.cs#L4-L16 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-ModuleInitializerAttribute ' title =' Start of snippet ' >anchor</a ></sup >
106+ <sup ><a href =' /src/Tests/ModuleInitSample.cs#L3-L15 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-ModuleInitializerAttribute ' title =' Start of snippet ' >anchor</a ></sup >
107107<!-- endSnippet -->
108108
109109
@@ -225,25 +225,24 @@ If consuming in a project that targets net461 or net462, a reference to System.V
225225<!-- snippet: IndexRange -->
226226<a id =' snippet-IndexRange ' ></a >
227227``` cs
228- [TestFixture ]
229228class IndexRangeSample
230229{
231230 [Test ]
232- public void Range ()
231+ public async Task Range ()
233232 {
234233 var substring = " value" [2 .. ];
235- Assert .AreEqual ( " lue" , substring );
234+ await Assert .That ( substring ). IsEqualTo ( " lue" );
236235 }
237236
238237 [Test ]
239- public void Index ()
238+ public async Task Index ()
240239 {
241240 var ch = " value" [^ 2 ];
242- Assert .AreEqual ( 'u' , ch );
241+ await Assert .That ( ch ). IsEqualTo ( 'u' );
243242 }
244243
245244 [Test ]
246- public void ArrayIndex ()
245+ public async Task ArrayIndex ()
247246 {
248247 var array = new []
249248 {
@@ -253,11 +252,11 @@ class IndexRangeSample
253252
254253 var value = array [^ 2 ];
255254
256- Assert .AreEqual ( " value1" , value );
255+ await Assert .That ( value ). IsEqualTo ( " value1" );
257256 }
258257}
259258```
260- <sup ><a href =' /src/Tests/IndexRangeSample.cs#L1-L35 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-IndexRange ' title =' Start of snippet ' >anchor</a ></sup >
259+ <sup ><a href =' /src/Tests/IndexRangeSample.cs#L1-L34 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-IndexRange ' title =' Start of snippet ' >anchor</a ></sup >
261260<!-- endSnippet -->
262261
263262
@@ -278,15 +277,15 @@ class IndexRangeSample
278277<!-- snippet: OverloadResolutionPriority -->
279278<a id =' snippet-OverloadResolutionPriority ' ></a >
280279``` cs
281- [TestFixture ]
282280public class OverloadResolutionPriorityAttributeTests
283281{
284282 [Test ]
285- public void Run ()
283+ public Task Run ()
286284 {
287285 int [] arr = [1 , 2 , 3 ];
288286 // Prints "Span" because resolution priority is higher
289287 Method (arr );
288+ return Task .CompletedTask ;
290289 }
291290
292291 [OverloadResolutionPriority (2 )]
@@ -1212,12 +1211,6 @@ The class `Polyfill` includes the following extension methods:
12121211 * ` void SetCanceled<T>(CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskcompletionsource-1.setcanceled?view=net-10.0#system-threading-tasks-taskcompletionsource-1-setcanceled(system-threading-cancellationtoken) )
12131212
12141213
1215- #### TaskWhenEach
1216-
1217- * ` IAsyncEnumerable<Task> WhenEach(IEnumerable<Task>, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.wheneach?view=net-10.0 )
1218- * ` IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(IEnumerable<Task<TResult>>, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.wheneach?view=net-10.0 )
1219-
1220-
12211214#### TextReader
12221215
12231216 * ` ValueTask<int> ReadAsync(Memory<char>, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.textreader.readasync?view=net-10.0#system-io-textreader-readasync(system-memory((system-char))-system-threading-cancellationtoken) )
@@ -1252,7 +1245,6 @@ The class `Polyfill` includes the following extension methods:
12521245 * ` int Nanoseconds() ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.timespan.nanoseconds?view=net-10.0 )
12531246 * ` bool TryFormat(Span<byte>, int, ReadOnlySpan<char>, IFormatProvider?) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.timespan.tryformat?view=net-10.0#system-timespan-tryformat(system-span((system-byte))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider) )
12541247 * ` bool TryFormat(Span<char>, int, ReadOnlySpan<char>, IFormatProvider?) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.timespan.tryformat?view=net-10.0#system-timespan-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider) )
1255- * ` TimeSpan FromMilliseconds(long) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.timespan.frommilliseconds?view=net-10.0 )
12561248
12571249
12581250#### Type
@@ -1346,17 +1338,6 @@ The class `Polyfill` includes the following extension methods:
13461338 * ` ExternalAttributes ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.ziparchiveentry.externalattributes?view=net-10.0 )
13471339
13481340
1349- #### ZipFile
1350-
1351- * ` Task CreateFromDirectoryAsync(string, string, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.createfromdirectoryasync?view=net-10.0 )
1352- * ` Task CreateFromDirectoryAsync(string, string, CompressionLevel, bool, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.createfromdirectoryasync?view=net-10.0 )
1353- * ` Task CreateFromDirectoryAsync(string, string, CompressionLevel, bool, Encoding, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.createfromdirectoryasync?view=net-10.0 )
1354- * ` Task ExtractToDirectoryAsync(string, string, bool, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectoryasync?view=net-10.0 )
1355- * ` Task ExtractToDirectoryAsync(string, string, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectoryasync?view=net-10.0 )
1356- * ` Task ExtractToDirectoryAsync(string, string, Encoding, bool, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectoryasync?view=net-10.0 )
1357- * ` Task ExtractToDirectoryAsync(string, string, Encoding, CancellationToken) ` [ reference] ( https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectoryasync?view=net-10.0 )
1358-
1359-
13601341#### Ensure
13611342
13621343 * ` void DirectoryExists(string) `
@@ -1505,7 +1486,7 @@ class NullabilityTarget
15051486<a id =' snippet-NullabilityUsage ' ></a >
15061487``` cs
15071488[Test ]
1508- public void Test ()
1489+ public async Task Test ()
15091490{
15101491 var type = typeof (NullabilityTarget );
15111492 var arrayField = type .GetField (" ArrayField" )! ;
@@ -1515,14 +1496,14 @@ public void Test()
15151496
15161497 var arrayInfo = context .Create (arrayField );
15171498
1518- Assert .AreEqual ( NullabilityState . NotNull , arrayInfo .ReadState );
1519- Assert .AreEqual ( NullabilityState . Nullable , arrayInfo .ElementType ! .ReadState );
1499+ await Assert .That ( arrayInfo .ReadState ). IsEqualTo ( NullabilityState . NotNull );
1500+ await Assert .That ( arrayInfo .ElementType ! .ReadState ). IsEqualTo ( NullabilityState . Nullable );
15201501
15211502 var genericInfo = context .Create (genericField );
15221503
1523- Assert .AreEqual ( NullabilityState . NotNull , genericInfo .ReadState );
1524- Assert .AreEqual ( NullabilityState . NotNull , genericInfo .GenericTypeArguments [0 ].ReadState );
1525- Assert .AreEqual ( NullabilityState . Nullable , genericInfo .GenericTypeArguments [1 ].ReadState );
1504+ await Assert .That ( genericInfo .ReadState ). IsEqualTo ( NullabilityState . NotNull );
1505+ await Assert .That ( genericInfo .GenericTypeArguments [0 ].ReadState ). IsEqualTo ( NullabilityState . NotNull );
1506+ await Assert .That ( genericInfo .GenericTypeArguments [1 ].ReadState ). IsEqualTo ( NullabilityState . Nullable );
15261507}
15271508```
15281509<sup ><a href =' /src/Tests/NullabilitySamples.cs#L6-L29 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-NullabilityUsage ' title =' Start of snippet ' >anchor</a ></sup >
@@ -1595,7 +1576,7 @@ void ArgumentExceptionExample(Order order, Customer customer, string customerId,
15951576 this .quantity = quantity ;
15961577}
15971578```
1598- <sup ><a href =' /src/Consume/Consume.cs#L377-L395 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-ArgumentExceptionUsage ' title =' Start of snippet ' >anchor</a ></sup >
1579+ <sup ><a href =' /src/Consume/Consume.cs#L378-L396 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-ArgumentExceptionUsage ' title =' Start of snippet ' >anchor</a ></sup >
15991580<!-- endSnippet -->
16001581
16011582
@@ -1614,7 +1595,7 @@ void EnsureExample(Order order, Customer customer, string customerId, string ema
16141595 this .quantity = Ensure .NotNegativeOrZero (quantity );
16151596}
16161597```
1617- <sup ><a href =' /src/Consume/Consume.cs#L401-L413 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-EnsureUsage ' title =' Start of snippet ' >anchor</a ></sup >
1598+ <sup ><a href =' /src/Consume/Consume.cs#L402-L414 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-EnsureUsage ' title =' Start of snippet ' >anchor</a ></sup >
16181599<!-- endSnippet -->
16191600
16201601
0 commit comments