vendredi 27 mai 2016

How to write a unit test to find if object is disposed in a method

I have regular method which does the database operation and then in finally block , I dispose the object . I would like to unit test to make sure object is disposed after dispose call.

try { this.OpenConnection ; 
database operation
}
catch(Exception ex)
{ }
finally
{ this.closeConnection;this.Dispose;}

Aucun commentaire:

Enregistrer un commentaire