public void WhenCopyParamsWithinValue_ThenPaste(int copyPosition, int copyLength, int pastePosition, string expected) { var sut = new CopyPasteCommand(copyPosition, copyLength, pastePosition).SetValue(Value); sut.Execute(); Assert.That(sut.Result, Is.EqualTo(expected)); }
public void WhenCopyLengthWouldGoOutOfRange_ThenCopyTillEnd(int copyPosition, int copyLength, int pastePosition, string expected) { var sut = new CopyPasteCommand(copyPosition, copyLength, pastePosition).SetValue(Value); sut.Execute(); Assert.That(sut.Result, Is.EqualTo(expected)); }
public void WhenPastePositionGreaterThanLength_ThenPasteAtEnd() { var sut = new CopyPasteCommand(0, 4, Value.Length + 1).SetValue(Value); sut.Execute(); Assert.That(sut.Result, Is.EqualTo(Value + "John")); }
public void WhenCopyPositionEqualsOrGreaterThanValueLength_ThenSetToSame(int copyPosition, int copyLength, int pastePosition) { var sut = new CopyPasteCommand(copyPosition, copyLength, pastePosition).SetValue(Value); sut.Execute(); Assert.That(sut.Result, Is.EqualTo(Value)); }
public void WhenCopyLengthIsLessThanOne_ThenSetToSame() { var sut = new CopyPasteCommand(0, 0, 5).SetValue(Value); sut.Execute(); Assert.That(sut.Result, Is.EqualTo(Value)); }
public void WhenValueIsNull_ThenSetToNull() { var sut = new CopyPasteCommand(0, 2, 5); sut.Execute(); Assert.That(sut.Result, Is.Null); }