Beispiel #1
0
        public void Handle_UsesTextCase_WhenRequested()
        {
            string[] argumentsWithCase = { "tEst_ComMand" };
            string[] argumentsNoCase   = { "test_command" };
            _sut.IgnoreCommandCase = false;

            _sut.Handle(argumentsNoCase);
            DummyCommand.CallCount.Should().Be(1);

            DummyCommand.ResetIndicators();

            _sut.Handle(argumentsWithCase);
            DummyCommand.CallCount.Should().Be(0);
        }
Beispiel #2
0
        public void Handle_ShouldFindCommand_RegardlessOfArgumentCase()
        {
            string[] arguments                   = { "test_command" };
            string[] argumentsWithCapitols       = { "Test_Command" };
            string[] argumentsWithRandomCapitols = { "TEst_ComManD" };

            _sut.Handle(arguments);
            DummyCommand.CallCount.Should().Be(1);

            DummyCommand.ResetIndicators();

            _sut.Handle(argumentsWithCapitols);
            DummyCommand.CallCount.Should().Be(1);

            DummyCommand.ResetIndicators();

            _sut.Handle(argumentsWithRandomCapitols);
            DummyCommand.CallCount.Should().Be(1);
        }