public void should_stop_auto_polling_when_disposing_or_disposed() { using (TestedClass) { Thread.Sleep(1000); var _beforeDispose = modulePolledCount; TestedClass.Dispose(); var _afterDispose = modulePolledCount; Thread.Sleep(2000); Assert.True(_beforeDispose <= modulePolledCount); Assert.True(_afterDispose >= modulePolledCount); } }
protected override void Because_Of() { TestedClass.Dispose(); }