Exemplo n.º 1
0
        public string Play(string text)
        {
            StringTreeNode node = _wordsDictionary.Find(text);

            List <StringTreeNode> winningOptions = GetWinningOptions(node);

            if (winningOptions.Any())
            {
                return(GetRandomOption(text, winningOptions));
            }

            return(GameExtendingLongestOption(text, node));
        }
Exemplo n.º 2
0
        public void ItShouldBuildTheTreeOnCreation()
        {
            var ex = Record.Exception(() => tree.Find("sleep"));

            Assert.Null(ex);
        }