Ejemplo n.º 1
0
        public void DisposeOfAProcessorThatIsNeverStarted()
        {
            var called = false;

            var target = new StubProcessor();

            target.SetupCallbacks(onDispose: () => called = true);

            target.Dispose();

            Assert.IsTrue(called);
        }
Ejemplo n.º 2
0
        public void ChangeTheProcessorStatesDuringStart()
        {
            var tested = false;

            using var target = new StubProcessor();
            target.SetupCallbacks(() =>
            {
                Assert.AreEqual(ProcessorState.Starting, target.State);
                tested = true;
            });

            target.Start();

            Assert.True(tested);
            Assert.AreEqual(ProcessorState.Started, target.State);
        }