public void LimitCountToEnd_WhenProvidingMaxLengthLessThanCount_MovesStartOffet() { var range = new EdgeRange(0, 9); Assert.Equal(10, range.Count); range.LimitCountToEnd(5); Assert.Equal(5, range.Count); Assert.Equal(9, range.EndOffset); Assert.Equal(5, range.StartOffset); }
public void LimitCountToEnd_IfMaxLengthIsNegative_ThrowsException() { var range = new EdgeRange(0, 10); Assert.Throws <ArgumentOutOfRangeException>(() => range.LimitCountToEnd(-1)); }