public ActionResult Save( Translation model)
 {
     Translation translation = _translationService.FindById(model.TranslationID);
     translation.Phrase = translation.Phrase.Trim();
     translation.TranslatedText = model.TranslatedText.Trim();
     _translationService.AddTranslation(translation);
     return RedirectToAction("Index");
 }
Esempio n. 2
0
        public void CanViewCreate()
        {
            //Act
            var translation = new Translation
                                  {
                                      LanguageCode = "001",
                                      Phrase = "phrase to be translated",
                                      TranslatedText = "translated"
                                  };
            var result = _translationController.Save(translation);

            //Assert
            Assert.IsInstanceOf<ActionResult>(result);
            Assert.IsInstanceOf<int>(translation.TranslationID);
        }