Exemplo n.º 1
0
        public void ValidUpdate_Commit_Test()
        {
            // Assign
            ITmxContext context = new TmxContext(MockObjects.VALID_TestFilesPath);
            TmxFile update = (from tmx in context.Get("en")
                               where tmx.FileInfo.FullName == MockObjects.VALID_Update_TmxFilePath.FullName
                               select tmx).First<TmxFile>();
            bool pass = context.Update(update);
            Assert.IsTrue(pass, "Context Update method is broken");

            // Act
            int result = context.SaveChanges();

            // Assert
            Assert.AreEqual(1, result);
        }
Exemplo n.º 2
0
        public void ValidEmptyHistory_Commit_Test()
        {
            // Assign
            ITmxContext context = new TmxContext(MockObjects.VALID_LanguageRepositoryPath);

            // Act
            int result = context.SaveChanges();

            // Assert
            Assert.AreEqual(0, result);
        }
Exemplo n.º 3
0
        public void ValidNoChanges_Commit_Test()
        {
            // Assign
            ITmxContext context = new TmxContext(MockObjects.VALID_LanguageRepositoryPath);
            List<TmxFile> files = context.Get("en");

            // Act
            int result = context.SaveChanges();

            // Assert
            Assert.AreEqual(0, result);
        }
Exemplo n.º 4
0
        public void ValidAdd_Commit_Test()
        {
            // Assign
            ITmxContext context = new TmxContext(MockObjects.VALID_TestFilesPath);
            bool pass = context.Add(MockObjects.VALID_en_Add_ContextTmxFile);
            Assert.IsTrue(pass, "Context Add method is broken");

            // Act
            int result = context.SaveChanges();

            // Assert
            Assert.AreEqual(1, result);
            Assert.IsTrue(File.Exists(MockObjects.VALID_en_Add_ContextTmxFilePath.FullName));
        }