public void GetRandomWords_NoArgs_NotEmpty() { var randomWordsService = new RandomWordsService(); string randomWord = randomWordsService.GetRandomWords(); Assert.NotEmpty(randomWord); }
private RandomWordsService InitializeService() { PancakeConfiguration pancakeConfiguration = new PancakeConfiguration { DBConnectionString = "Host=localhost;Database=Words;Username=postgres;Password=marshmallow" }; RandomWordsService randomWordsService = new RandomWordsService(); randomWordsService.Init(pancakeConfiguration); return(randomWordsService); }
public void CanGetRandomNoun() { var request = new GetRandomWordRequest(""); request.MinCorpusCount = 100000; request.ExcludePartsOfSpeech = new List <PartOfSpeech>() { PartOfSpeech.ProperNoun, PartOfSpeech.ProperNounPlural, PartOfSpeech.ProperNounPossesive, PartOfSpeech.Suffix, PartOfSpeech.FamilyName, PartOfSpeech.GivenName, PartOfSpeech.Idiom, PartOfSpeech.Affix, PartOfSpeech.NounPlural, PartOfSpeech.NounPossessive }; request.IncludePartsOfSpeech = new List <PartOfSpeech>() { PartOfSpeech.Noun }; request.MaximumLength = 10; var service = new RandomWordsService(new GetWordnikBaseUrlQuery()); var response = service.GetRandomWord(request); Console.WriteLine(response.Word.Word); }