public void TestCleanup() { try { _adapter.Dispose(); _adapter = null; } catch (Exception e) { Assert.Fail("Failed to dispose storage adapter: {0}", e.Message); } try { System.IO.File.Delete(DatabasePath); } catch { // Db file might not exist or might fail to be deleted. } }
public void TestCleanup() { try { // Try to clean up resources but don't fail the test if that throws an error. _storageAdapter.Dispose(); _storageAdapter = null; File.Delete(_storagePath); } catch { // No-op. } }
public async ValueTask DisposeAsync() { _storageAdapter.Dispose(); await Task.CompletedTask; }