public void WhenCommandsIsEmpty_ThenSetResultToValue() { var sut = new StringChainedCommand(new List <StringCommand>()).SetValue(Value); sut.Execute(); Assert.That(sut.Result, Is.EqualTo(Value)); }
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.")); }