コード例 #1
0
        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);
        }
コード例 #2
0
        public void Update_NonExist_TmxFile_Test()
        {
            // Assign
            AbstractLanguageRepository repository = new LanguageRepository();

            // Act
            bool result = repository.Update(MockObjects.NonEXIST_Add_TmxFile);

            // Assert
            Assert.IsFalse(result);
        }