Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }