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)); }
public void ItShouldBuildTheTreeOnCreation() { var ex = Record.Exception(() => tree.Find("sleep")); Assert.Null(ex); }