public void GetTextRange_WhenLengthNegative_Throws()
        {
            var document = new SplashDocument();
            document.AppendText("some text...");

            Assert.Throws<ArgumentOutOfRangeException>(() => document.GetTextRange(0, -1));
        }
Example #2
0
        public void GetTextRange_WhenStartIndexPlusLengthExceedsDocument_Throws()
        {
            var document = new SplashDocument();

            document.AppendText("some text...");

            Assert.Throws <ArgumentOutOfRangeException>(() => document.GetTextRange(10, 3));
        }
Example #3
0
        public void GetTextRange_WhenLengthNegative_Throws()
        {
            var document = new SplashDocument();

            document.AppendText("some text...");

            Assert.Throws <ArgumentOutOfRangeException>(() => document.GetTextRange(0, -1));
        }
Example #4
0
        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_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));
        }