Exemple #1
0
        public void Should_return_proper_count_of_matches()
        {
            var result = _sut.GetMatches(null, new [] { "G", "CC", "GG", "cc" });

            result["G"].Count.ShouldBe(2);
            result["CC"].Count.ShouldBe(2);
            result["cc"].Count.ShouldBe(0);
            result["GG"].Count.ShouldBe(1);
        }
        public StringSearchModule(IBoyerMooreProvider provider)
        {
            _provider = provider;

            Post["/StringSearch/Match"] = _ =>
            {
                var data = this.Bind <BoyerMooreModel>();
                return(Response.AsJson(_provider.GetMatches(data, data.Searches, data.IgnoreCase, data.StartIndex)));
            };
        }