// This method is used by subclass to dispose of disposable objects // such as LocalEnvironment. // It is called as a first step in test clean up. protected virtual void CleanupCore() { if (Env != null) { Env.Dispose(); } Env = null; }
// This method is used by subclass to dispose of disposable objects // such as LocalEnvironment. // It is called as a first step in test clean up. protected override void Cleanup() { _env?.Dispose(); _env = null; Contracts.Assert(IsActive); Log("Test {0}: {1}: {2}", TestName, _normal ? "completed normally" : "aborted", _passed ? "passed" : "failed"); Contracts.AssertValue(LogWriter); LogWriter.Dispose(); LogWriter = null; base.Cleanup(); }