コード例 #1
0
        public void Get_word_translation_in_oposite_direction_2_words_are_in_dictionary()
        {
            var service = new WordsService.Words();
            var result = service.AddNewEntry("weak", "weak translation");
            Assert.IsTrue(result);

            result = service.AddNewEntry("strong", "strong translation");
            Assert.IsTrue(result);

            var translations = service.GetWord("strong translation");
            Assert.AreEqual("strong", translations[0]);

            translations = service.GetWord("weak translation");
            Assert.AreEqual("weak", translations[0]);
        }
コード例 #2
0
 public void Get_word_translation_word_is_in_dictionary()
  {
      var service = new WordsService.Words();
      var result = service.AddNewEntry("weak", "weak translation");
      var translations = service.GetWord("weak");
      Assert.AreEqual("weak translation", translations[0]);
  }
コード例 #3
0
        public void Get_everything_that_conatins_word()
        {
            var service = new WordsService.Words();
            var result = service.AddNewEntry("weak", "weak translation");
            Assert.IsTrue(result);

            result = service.AddNewEntry("strong", "strong translation");
            Assert.IsTrue(result);

            var translations = service.GetWord("translation");
            var lst = new List<string> { "weak", "strong" };
            for (int i = 0; i < lst.Count; i++)
                Assert.AreEqual(lst[i], translations[i]);
        }
コード例 #4
0
 public void Get_word_that_is_not_present_in_dictionary()
 {
     var service = new WordsService.Words();
     var result = service.AddNewEntry("weak", "weak translation");
     Assert.IsTrue(result);
    
     var translations = service.GetWord("powerfull");
     Assert.IsNull(translations);
 }
コード例 #5
0
        public void Add_new_word_to_existing_translation()
        {
            var service = new WordsService.Words();
            var result = service.AddNewEntry("weak", "weak translation");
            Assert.IsTrue(result);

            result = service.AddNewEntry("strong", "strong translation");
            Assert.IsTrue(result);

            result = service.AddNewEntry("weak translation", "not powerfull");

            Assert.IsTrue(result);
            var words = service.GetWord("weak translation");

            var lst = new List<string> { "weak", "not powerfull" };
            for (int i = 0; i < lst.Count; i++)
                Assert.AreEqual(lst[i], words[i]);

        }