public void AsciiStringSubStringThrowsIfStartIndexIsNegative() { string value = "9quali52ty3"; var ascii = new AsciiString(value); Assert.Throws <ArgumentOutOfRangeException>(() => ascii.SubString(-1, 1)); }
public void AsciiStringSubStringThrowsIfStartIndexPlusLengthIsOutOfRange() { string value = "9quali52ty3"; var ascii = new AsciiString(value); Assert.Throws <ArgumentOutOfRangeException>(() => ascii.SubString(0, value.Length + 1)); }
public void AsciiStringSubString() { var asciiString = new AsciiString(_input); var newAsciiString = asciiString.SubString(0, Number); Assert.AreEqual(Number, newAsciiString.Length); }
public void AsciiStringSubStringReturnsExpectedFullSubString() { string value = "9quali52ty3"; string expected = value.Substring(0, value.Length); var ascii = new AsciiString(value); var subString = ascii.SubString(0, value.Length); Assert.AreEqual(expected, subString.ToString()); }