コード例 #1
0
        public void SingleTest()
        {
            var sut    = new AutocompleteSystem(new string[] { "d", "a", "deer", "deal" });
            var result = sut.Query("d");

            ArraysEqual(result, new string[] { "d", "deer", "deal" });
            result = sut.Query("a");
            ArraysEqual(result, new string[] { "a" });
        }
コード例 #2
0
        public void OtherTest1()
        {
            var sut    = new AutocompleteSystem(new string[] { "", "d", "a", "deer", "deal", "buzzword", "buz1word" });
            var result = sut.Query("buzz");

            ArraysEqual(result, new string[] { "buzzword" });
        }
コード例 #3
0
        public void NotFoundTest()
        {
            var sut    = new AutocompleteSystem(new string[] { "d", "a", "deer", "deal" });
            var result = sut.Query("n");

            ArraysEqual(result, new string[] { });
        }
コード例 #4
0
        public void ReferenceTest()
        {
            var sut    = new AutocompleteSystem(new string[] { "dog", "deer", "deal" });
            var result = sut.Query("de");

            ArraysEqual(result, new string[] { "deer", "deal" });
        }