コード例 #1
0
        public void Process_WithNotRegisteredHandler_ShouldThrowException()
        {
            // Assign
            FakeUnregisteredCommand        command   = new FakeUnregisteredCommand();
            ICommandProcessor <FakeStatus> processor = new FakeStatefulCommandProcessor();

            // Act, Assert
            Assert.Throws <ArgumentException>(() => processor.Process(command));
        }
コード例 #2
0
        public void Process_WithRegisteredHandler_ShouldReturnNotNull()
        {
            // Assign
            FakeCommand command = new FakeCommand();
            ICommandProcessor <FakeStatus> processor = new FakeStatefulCommandProcessor();

            // Act
            FakeStatus result = processor.Process(command);

            // Assert
            Assert.NotNull(result);
        }
コード例 #3
0
        public void CanProcess_WithNotRegisteredHandler_ShouldReturnFalse()
        {
            // Assign
            FakeUnregisteredCommand        command   = new FakeUnregisteredCommand();
            ICommandProcessor <FakeStatus> processor = new FakeStatefulCommandProcessor();

            // Act
            bool canProcess = processor.CanProcess(command);

            // Assert
            Assert.False(canProcess);
        }