Exemple #1
0
            public void WhenCommandsIsEmpty_ThenSetResultToValue()
            {
                var sut = new StringChainedCommand(new List <StringCommand>()).SetValue(Value);

                sut.Execute();

                Assert.That(sut.Result, Is.EqualTo(Value));
            }
Exemple #2
0
            public void WhenMultipleCommands_ThenSetValue()
            {
                var commands = new List <StringCommand>
                {
                    new CaseToLowerCommand(),
                    new InsertCommand(100, " lives in England."),
                    new CutPasteCommand(5, 5, 0)
                };

                var sut = new StringChainedCommand(commands).SetValue(Value);

                sut.Execute();

                Assert.That(sut.Result, Is.EqualTo("smithjohn  lives in England."));
            }