Exemplo n.º 1
0
 public void ToStringCountOverLengthThrows()
 {
     using (var buffer = new StringBuffer())
     {
         Assert.Throws<ArgumentOutOfRangeException>(() => buffer.Substring(startIndex: 0, count: 1));
     }
 }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
 public void ToStringNegativeCountThrows()
 {
     using (var buffer = new StringBuffer())
     {
         Assert.Throws<ArgumentOutOfRangeException>(() => buffer.Substring(startIndex: 0, count: -2));
     }
 }