コード例 #1
0
        public void Get_Bing_Suggestion_Translation()
        {
            //Arrange
            TranslateController controller = new TranslateController();
            ITranslatorRepo translatorRepoMock = new TranslatorRepoMock();
            //Act

            //Assert
        }
コード例 #2
0
        // [TestMethod]
        public void Translate_All_For_Japanese()
        {
            //Arrange
            TranslateController controller = new TranslateController();
            //ITranslatorRepo translatorRepoMock = new TranslatorRepoMock();
               // ITranslatorRepo translatorRepo = new TranslatorRepo();
            //controller.translatorRepo = translatorRepo;
            IWebTextRepo webTextRepo = new WebTextRepoMock();
            controller.WebTextRepo = webTextRepo;
            //Act
            List<WebText> translatedWebText = controller.TranslateWebTexts("en", "sv");
               // controller.TranslateAll("en", "sv", "Home");

            //Assert
              Assert.AreEqual(translatedWebText[0].HtmlText,"Senaste nytt");
        }
コード例 #3
0
        public void Test_RavenDB_SearchWebTextLeftJoin()
        {
            // Arrange
            TranslateController controller = new TranslateController();
            var realRepo = new WebTextRepoRavenDB();
            controller.WebTextRepo = realRepo;
            string controllName = "Home";
            string actionName = "Index";
            string langName = "jp";
            string fromLang = "en";
            string message = "Translate Shorjini Kempo Camp Stockholm 2014 for language " + langName;
            // Act
            ViewResult result = controller.Index(controllName, actionName, langName, fromLang) as ViewResult;

            // Assert
            Assert.AreEqual(message, result.ViewBag.Message);
        }