Ejemplo n.º 1
0
        public void ShouldNotAllowToExecuteIfProcessingEngineIsNull()
        {
            // Given
            var command = new StopImageProcessingCommand(null);

            // When
            // Then
            Assert.IsFalse(command.CanExecute());
        }
Ejemplo n.º 2
0
        public void ShouldNotAllowToStopNotStartedProcessingEngine()
        {
            // Given
            var processingEngineMock = new Mock <IProcessingEngine>();

            processingEngineMock.Setup(s => s.IsWorking()).Returns(false);
            var processingServiceMock = new Mock <IProcessingService>();

            processingServiceMock.SetupGet(ps => ps.ProcessingEngine).Returns(processingEngineMock.Object);

            var command = new StopImageProcessingCommand(processingServiceMock.Object);

            // When
            // Then
            Assert.IsFalse(command.CanExecute());
        }