public void Dispose_True2() { var isManagedResourceReleased = false; var isUnmanagedResourceReleased = false; var obj = new Disposable1(); obj.ReleaseManagedResource = () => isManagedResourceReleased = true; obj.ReleaseUnmanagedResource = () => isUnmanagedResourceReleased = true; obj.Dispose(); Assert.AreEqual(true, isManagedResourceReleased); Assert.AreEqual(true, isUnmanagedResourceReleased); }
public void Dispose_False() { var isManagedResourceReleased = false; var isUnmanagedResourceReleased = false; var obj = new Disposable1(); obj.ReleaseManagedResource = () => isManagedResourceReleased = true; obj.ReleaseUnmanagedResource = () => isUnmanagedResourceReleased = true; Assert.AreEqual(false, isManagedResourceReleased); Assert.AreEqual(false, isUnmanagedResourceReleased); Assert.Inconclusive("デバッグして、Disposable1.Dispose メソッドを目視で確認してください。"); }