Exemple #1
0
        public void DisposeAllDisposables()
        {
            TestDisposable disposable1 = new TestDisposable();
            TestDisposable disposable2 = new TestDisposable();

            using (TestAgent agent = new TestAgent(Substitute.For <IMessageBoard>()))
            {
                agent.MarkForDispose(disposable1);
                agent.MarkForDispose(disposable2);
            }

            disposable1.IsDisposed.Should().BeTrue("all disposables should be disposed on dispose.");
            disposable2.IsDisposed.Should().BeTrue("all disposables should be disposed on dispose.");
        }