public void GetTextRange_WhenLengthNegative_Throws() { var document = new SplashDocument(); document.AppendText("some text..."); Assert.Throws<ArgumentOutOfRangeException>(() => document.GetTextRange(0, -1)); }
public void GetTextRange_WhenStartIndexPlusLengthExceedsDocument_Throws() { var document = new SplashDocument(); document.AppendText("some text..."); Assert.Throws <ArgumentOutOfRangeException>(() => document.GetTextRange(10, 3)); }
public void GetTextRange_WhenLengthNegative_Throws() { var document = new SplashDocument(); document.AppendText("some text..."); Assert.Throws <ArgumentOutOfRangeException>(() => document.GetTextRange(0, -1)); }
public void GetTextRange_WhenRangeValid_ReturnsRange(int startIndex, int length) { var document = new SplashDocument(); document.AppendText("some text..."); Assert.AreEqual("some text...".Substring(startIndex, length), document.GetTextRange(startIndex, length)); }
public void GetTextRange_WhenStartIndexPlusLengthExceedsDocument_Throws() { var document = new SplashDocument(); document.AppendText("some text..."); Assert.Throws<ArgumentOutOfRangeException>(() => document.GetTextRange(10, 3)); }