public void MoveTo(int startPos, int newPos) { // Arrange var line = new InMemoryLineView(); line.Type("test"); line.MoveTo(startPos); // Act line.MoveTo(newPos); // Assert Assert.Equal(newPos, line.Position); }
public void NotMoveToOutsideBoundaries(int newPos) { // Arrange var line = new InMemoryLineView(); // Act, Assert Assert.Throws <ArgumentOutOfRangeException>(() => line.MoveTo(newPos)); }
public void TypeCharValue(string startValue, int startPos, char value, string expextedValue, int expextedPos) { // Arrange var line = new InMemoryLineView(); line.Type(startValue); line.MoveTo(startPos); // Act line.Type(value); // Assert Assert.Equal(expextedValue, line.ToString()); Assert.Equal(expextedPos, line.Position); }
public void Delete(string startValue, int startPos, int deleteCount, string expextedValue, int expextedPos) { // Arrange var line = new InMemoryLineView(); line.Type(startValue); line.MoveTo(startPos); // Act line.Delete(deleteCount); // Assert Assert.Equal(expextedValue, line.ToString()); Assert.Equal(expextedPos, line.Position); }