public void ThrowsObjectDisposedException_WhenDisposedTwice()
            {
                var subject = new DisposableCallback(() => { });

                subject.Dispose();
                Assert.Throws <ObjectDisposedException>(() => subject.Dispose());
            }
예제 #2
0
파일: Dispose.cs 프로젝트: vipwan/Fluxor
        public void WhenCalledTwice_ThenThrowsObjectDisposedException()
        {
            var subject = new DisposableCallback("Test", () => { });

            subject.Dispose();
            Assert.Throws <ObjectDisposedException>(() => subject.Dispose());
        }
예제 #3
0
        public void WhenCalledTwice_ThenThrowsObjectDisposedException()
        {
            var subject = new DisposableCallback(
                $"{nameof(DisposeTests)}.{nameof(WhenCalledTwice_ThenThrowsObjectDisposedException)}",
                () => { });

            subject.Dispose();
            Assert.Throws <ObjectDisposedException>(() => subject.Dispose());
        }
예제 #4
0
파일: Dispose.cs 프로젝트: vipwan/Fluxor
        public void WhenCalled_ThenCallsActionPassedInConstructor()
        {
            bool   wasCalled = false;
            Action action    = () => wasCalled = true;
            var    subject   = new DisposableCallback("Test", action);

            Assert.False(wasCalled);
            subject.Dispose();
            Assert.True(wasCalled);
        }