File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/AdoNet.Specification.Tests Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,28 @@ public virtual void Dispose_can_be_called_more_than_once()
230
230
connection . Dispose ( ) ;
231
231
}
232
232
233
+ [ Fact ]
234
+ public virtual void Dispose_raises_Disposed ( )
235
+ {
236
+ var connection = CreateOpenConnection ( ) ;
237
+ var disposedCount = 0 ;
238
+ connection . Disposed += ( s , e ) => disposedCount ++ ;
239
+ connection . Dispose ( ) ;
240
+ Assert . Equal ( 1 , disposedCount ) ;
241
+ }
242
+
243
+ #if NETSTANDARD2_1_OR_GREATER
244
+ [ Fact ]
245
+ public virtual async Task DisposeAsync_raises_Disposed ( )
246
+ {
247
+ var connection = CreateOpenConnection ( ) ;
248
+ var disposedCount = 0 ;
249
+ connection . Disposed += ( s , e ) => disposedCount ++ ;
250
+ await connection . DisposeAsync ( ) . ConfigureAwait ( false ) ;
251
+ Assert . Equal ( 1 , disposedCount ) ;
252
+ }
253
+ #endif
254
+
233
255
[ Fact ]
234
256
public virtual void CreateCommand_returns_command ( )
235
257
{
You can’t perform that action at this time.
0 commit comments