コード例 #1
0
        public void CantCallDispatchAfterOnDisposedQueue()
        {
            var sq = new SerialQueue(invalidPool);

            sq.Dispose();
            var hit = new List <int>();

            AssertEx.Throws <ObjectDisposedException>(() => {
                sq.DispatchAfter(TimeSpan.FromMilliseconds(100), () => hit.Add(1));
            });
        }
コード例 #2
0
        public void CantCallDispatchAsyncOnDisposedQueue()
        {
            var sq = new SerialQueue(invalidPool);

            sq.Dispose();
            var hit = new List <int>();

            AssertEx.Throws <ObjectDisposedException>(() => {
                sq.DispatchAsync(() => hit.Add(1));
            });
        }