Exemple #1
0
 public void WritingSystemLdmlVersionGetterGetFileVersion_FileHasNoVersion_ReturnsminusOne()
 {
     using (_environment = new TestEnvironment())
     {
         _environment.WriteContentToWritingSystemLdmlFile(LdmlContentForTests.Version0English());
         var versionGetter = new WritingSystemLdmlVersionGetter();
         Assert.AreEqual(-1, versionGetter.GetFileVersion(_environment.PathToWritingSystemLdmlFile));
     }
 }
Exemple #2
0
 public void MigrateIfNeeded_LdmlV0ContainsIdThatIsNotMigrated_WritingSystemChangeLogDoesNotExist()
 {
     using (var e = new TestEnvironment())
     {
         string writingSystemsPath  = Path.Combine(e.ProjectPath, "WritingSystems");
         string ldmlFilePath        = Path.Combine(writingSystemsPath, "en.ldml");
         string idChangeLogFilePath = Path.Combine(writingSystemsPath, "idchangelog.xml");
         Directory.CreateDirectory(writingSystemsPath);
         File.WriteAllText(ldmlFilePath, LdmlContentForTests.Version0English());
         var migrator = new WritingSystemsMigrator(e.ProjectPath);
         migrator.MigrateIfNecessary();
         // The change log does not exist because no id needed migrating
         Assert.That(File.Exists(idChangeLogFilePath), Is.Not.True);
     }
 }