public void OnDisposedWhenAfterDisposePasses() { var layout = new TestLayout(); var callCounter = 0; ILayout recievedSelf = null; layout.OnDisposed.Add((_self) => { callCounter++; recievedSelf = _self; }); layout.Dispose(); callCounter = 0; recievedSelf = null; layout.Dispose(); Assert.AreEqual(0, callCounter); Assert.IsNull(recievedSelf); }
public void OnDisposedPasses() { var layout = new TestLayout(); var callCounter = 0; ILayout recievedSelf = null; layout.OnDisposed.Add((_self) => { callCounter++; recievedSelf = _self; }); layout.Dispose(); Assert.AreEqual(1, callCounter); Assert.AreEqual(layout, recievedSelf); }