public void ReturnsFalseWhenTheProcessorHasNotBeenAdded()
        {
            using var target = new AutomationRuntime();
            var result = target.Remove(processor.Object);

            Assert.False(result);
        }
        public void ReturnsTrueWhenTheProcessorHasBeenAdded()
        {
            using var target = new AutomationRuntime();
            var result = target.Add(processor.Object);

            Assert.True(result);
        }
        public void ReturnsTheProcessorsThatHaveBeenAdded()
        {
            using var target = new AutomationRuntime();
            target.Add(processor.Object);

            Assert.True(target.Processors.Contains(processor.Object));
        }
        public void ThrowAnExceptionWhenStoppedAfterDisposed()
        {
            var target = new AutomationRuntime();

            target.Dispose();

            Assert.Throws <ObjectDisposedException>(() => target.Stop());
        }
        public void IdentifiesTrueIfTheProcessorIsBusy()
        {
            processor.Setup(o => o.State).Returns(ProcessorState.Busy);

            using var target = new AutomationRuntime();
            target.Add(processor.Object);

            Assert.True(target.IsActive);
        }
        public void StopsTheProcessor()
        {
            using var target = new AutomationRuntime();
            target.Add(processor.Object);

            target.Stop();

            processor.Verify(o => o.Stop(), Times.Once);
        }
 public void ThrowsAnExceptionIfTheProcessorIsNullWhenRemoved()
 {
     using var target = new AutomationRuntime();
     Assert.Throws <ArgumentNullException>(() => target.Remove(null));
 }