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 NotTypeEmptyStringValue(string value) { // Arrange var line = new InMemoryLineView(); // Act line.Type(value); // Assert Assert.Equal("", line.ToString()); }
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 ReturnValidStringStartedAtWithLength( string startValue, int start, int length, string expected) { // Arrange var line = new InMemoryLineView(); line.Type(startValue); // Act string actual = line.ToString(start, length); // Assert Assert.Equal(expected, actual); }
public void ReturnValidString() { // Arrange var line = new InMemoryLineView(); string expected = "test"; line.Type(expected); // Act string actual = line.ToString(); // Assert Assert.Equal(expected, actual); }
public void Clear(string startValue) { // Arrange var line = new InMemoryLineView(); line.Type(startValue); // Act line.Clear(); // Assert Assert.Equal("", line.ToString()); Assert.Equal(0, 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); }