|
/// <inheritdoc /> |
|
public void Dispose() |
|
=> (_host as IDisposable)?.Dispose(); |
|
|
|
#if NETCOREAPP |
|
/// <inheritdoc /> |
|
public ValueTask DisposeAsync() |
|
=> _host is IAsyncDisposable asyncDisposable |
|
? asyncDisposable.DisposeAsync() |
|
: ValueTask.CompletedTask; |
|
#endif |
If _host is IDisposable but not IAsyncDisposable (e.g, ServerTestHost and TestHostControllersTestHost), and TestApplication.DisposeAsync is called, it will do nothing. This doesn't make sense.
Generally speaking, there is excessive usage of unnecessary IAsyncDisposable in MTP (IMO), but this one specifically looks wrong.
testfx/src/Platform/Microsoft.Testing.Platform/Builder/TestApplication.cs
Lines 213 to 223 in f820ad1
If
_hostis IDisposable but not IAsyncDisposable (e.g,ServerTestHostandTestHostControllersTestHost), andTestApplication.DisposeAsyncis called, it will do nothing. This doesn't make sense.Generally speaking, there is excessive usage of unnecessary
IAsyncDisposablein MTP (IMO), but this one specifically looks wrong.