public void ToStringCountOverLengthThrows() { using (var buffer = new StringBuffer()) { Assert.Throws<ArgumentOutOfRangeException>(() => buffer.Substring(startIndex: 0, count: 1)); } }
public void ToStringTest(string source, int startIndex, int count, string expected) { using (var buffer = new StringBuffer(source)) { Assert.Equal(expected, buffer.Substring(startIndex: (ulong)startIndex, count: count)); } }
public void ToStringNegativeCountThrows() { using (var buffer = new StringBuffer()) { Assert.Throws<ArgumentOutOfRangeException>(() => buffer.Substring(startIndex: 0, count: -2)); } }