@@ -150,26 +150,6 @@ public async Task DisposeAsync_ThenDispose_IsIdempotent()
150150 Assert . Equal ( 1 , counter . DisposedCount ) ;
151151 }
152152
153- [ Fact ]
154- public async Task DisposeAsyncCore_Override_WithException_StillCallsDispose ( )
155- {
156- var services = new ServiceCollection ( ) ;
157- services . AddSingleton < Counter > ( ) ;
158- services . AddTransient < MyService > ( ) ;
159- var serviceProvider = services . BuildServiceProvider ( ) ;
160-
161- var renderer = new TestRenderer ( serviceProvider ) ;
162- var component = ( ComponentWithThrowingDisposeAsyncCore ) renderer . InstantiateComponent < ComponentWithThrowingDisposeAsyncCore > ( ) ;
163-
164- _ = component . MyService ;
165-
166- await Assert . ThrowsAsync < InvalidOperationException > ( async ( ) =>
167- await ( ( IAsyncDisposable ) component ) . DisposeAsync ( ) ) ;
168-
169- Assert . True ( component . DisposingParameter ) ;
170- Assert . True ( component . IsDisposedPublic ) ;
171- }
172-
173153 private class ComponentWithDispose : OwningComponentBase < MyService >
174154 {
175155 public MyService MyService => Service ;
@@ -184,25 +164,6 @@ protected override void Dispose(bool disposing)
184164 }
185165 }
186166
187- private class ComponentWithThrowingDisposeAsyncCore : OwningComponentBase < MyService >
188- {
189- public MyService MyService => Service ;
190- public bool ? DisposingParameter { get ; private set ; }
191- public bool IsDisposedPublic => IsDisposed ;
192-
193- protected override async ValueTask DisposeAsyncCore ( )
194- {
195- await base . DisposeAsyncCore ( ) ;
196- throw new InvalidOperationException ( "Something went wrong in async disposal" ) ;
197- }
198-
199- protected override void Dispose ( bool disposing )
200- {
201- DisposingParameter = disposing ;
202- base . Dispose ( disposing ) ;
203- }
204- }
205-
206167 private class MyOwningComponent : OwningComponentBase < MyService >
207168 {
208169 public MyService MyService => Service ;
0 commit comments