Example #1
0
 public void Dispose()
 {
     try
     {
         _instance.Cleanup();
         _instanceFactory.NotifyCurrentInstanceContextDisposed(canReuse: true);
     }
     catch (Exception)
     {
         // If the cleanup process fails, we want to make sure the next test gets a new instance. However,
         // we still want to raise this exception to fail this test
         _instanceFactory.NotifyCurrentInstanceContextDisposed(canReuse: false);
         throw;
     }
 }