public void Update_Valid_TmxFile_Test() { // Assign AbstractLanguageRepository repository = new LanguageRepository(); TmxFile current = (from tmx in repository.Get(MockObjects.VALID_TestFilesPath) where tmx.FileInfo.FullName == MockObjects.VALID_Update_TmxFilePath.FullName select tmx).First<TmxFile>(); // Act bool result = repository.Update(MockObjects.VALID_Update_TmxFile); // Assert Assert.IsTrue(result); TmxFile updated = (from tmx in repository.Get(MockObjects.VALID_TestFilesPath) where tmx.FileInfo.FullName == MockObjects.VALID_Update_TmxFilePath.FullName select tmx).First<TmxFile>(); Assert.AreNotEqual(current, updated); Assert.AreNotEqual(current.Data.Body.TranslationUnits.Count, updated.Data.Body.TranslationUnits.Count); }
public void Get_Valid_TmxFiles_By_Invalid_LanguageCode_Test() { // Assign AbstractLanguageRepository repository = new LanguageRepository(); // Act List<TmxFile> result = repository.Get(MockObjects.VALID_LanguageRepositoryPath, "la"); // Assert Assert.AreEqual(0, result.Count); }
public void Get_Valid_TmxFiles_By_Valid_LanguageCode_Test() { // Assign AbstractLanguageRepository repository = new LanguageRepository(); // Act List<TmxFile> result = repository.Get(MockObjects.VALID_LanguageRepositoryPath, "en"); // Assert Assert.AreEqual(2, result.Count); foreach (TmxFile file in result) { Assert.AreEqual("en", file.LanguageCode); } }