public void Dispose_InvokeDisposingNoForm_Nop(bool disposing) { using var context = new SubApplicationContext(); context.Dispose(disposing); Assert.Null(context.MainForm); context.Dispose(disposing); Assert.Null(context.MainForm); }
public void Dispose_InvokeNotDisposingWithForm_Nop() { using var mainForm = new Form(); using var context = new SubApplicationContext(mainForm); context.Dispose(false); Assert.Same(mainForm, context.MainForm); Assert.False(mainForm.IsDisposed); context.Dispose(false); Assert.Same(mainForm, context.MainForm); Assert.False(mainForm.IsDisposed); }
public void Dispose_InvokeDisposingWithForm_Success() { using var mainForm = new Form(); using var context = new SubApplicationContext(mainForm); context.Dispose(true); Assert.Null(context.MainForm); Assert.True(mainForm.IsDisposed); context.Dispose(true); Assert.Null(context.MainForm); Assert.True(mainForm.IsDisposed); }