SetStartIndex() public method

public SetStartIndex ( int index ) : void
index int
return void
コード例 #1
0
        public void MatchIndexIsCorrectlyOffsetWhenUsingStartIndex()
        {
            string source = "Some St!ring";
            var matcher = new ExcludeStringMatcher(source);

            matcher.SetStartIndex(5);

            Assert.Equal(7, matcher.FindNextIndex('!'));
        }
コード例 #2
0
        public void DoesntFindAMatchWhenMatchIsBeforeStartIndex()
        {
            string source = "Some!String";
            var matcher = new ExcludeStringMatcher(source);

            matcher.SetStartIndex(5);

            Assert.Null(matcher.FindNextIndex('!'));
        }