Example #1
0
        public void GetTranslations_MakesACallOnTheScraperWithTheWord()
        {
            // Arrange
            string word = "blabla";


            // Act
            var result = provider.GetTranslations(word);

            // Assert
            GetMock <ITranslationScraper>().Verify(s => s.Scrape(word), Times.Once());
        }
Example #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //infra
            var scraper = new WordReferenceScraper(new HtmlDocumentFactory(), new WordReferenceURLBuilder(), new CaretAnalyser(new UseLessStringCleaner()));

            translationsList.Clear();

            //infra
            var dataProvider = new DataProvider(dataAccesser.ConnectToDB());

            //domain
            var untranslatedWords = new UntranslatedWordsProvider(dataProvider).GetAll().ToList();

            //domain
            var translationProvider = new TranslationProvider(scraper);

            //app
            translationsList.Add(new TranslationUI(translationProvider.GetTranslations(untranslatedWords[0]) as Translation));

            translationsList.Add(new TranslationUI(translationProvider.GetTranslations(untranslatedWords[1]) as Translation));
        }