Exemplo n.º 1
0
        public void GivenMagicDictionaryAndWordOfDifferentLength_Search_ShouldReturnFalse()
        {
            var input = new string[] { "hello", "world" };
            var word  = "hell";

            var magicDict = new MagicDictionary().Build(input);

            var result = magicDict.Search(word);

            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        public void GivenTwoWordOfSimilarConstructionAndInvalidWordInMagicDictionary2_Search_ShouldReturnFalse()
        {
            var input = new string[] { "hello", "helli" };
            var word  = "hello";

            var magicDict = new MagicDictionary().Build(input);

            var result = magicDict.Search(word);

            Assert.IsFalse(result);
        }
Exemplo n.º 3
0
        public void GivenMagicDictionaryAndValidWord_Search_ShouldReturnTrue()
        {
            var input = new string[] { "hello", "world" };
            var word  = "hhllo";

            var magicDict = new MagicDictionary().Build(input);

            var result = magicDict.Search(word);

            Assert.IsTrue(result);
        }