public void WritingSystemLdmlVersionGetterGetFileVersion_FileIsVersion1_Returns1() { using (_environment = new TestEnvironment()) { _environment.WriteContentToWritingSystemLdmlFile(LdmlContentForTests.Version1English()); var versionGetter = new WritingSystemLdmlVersionGetter(); Assert.AreEqual(1, versionGetter.GetFileVersion(_environment.PathToWritingSystemLdmlFile)); } }
public int GetFileVersion(string fileName) { var versionReader = new WritingSystemLdmlVersionGetter(); string filePath = Path.Combine(MigratedLdmlFolder, fileName); return versionReader.GetFileVersion(filePath); }
public void Migrate_LdmlIsVersion0_IsLatestVersion() { using (var environment = new TestEnvironment()) { environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0English()); var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback); migrator.Migrate(); var versionGetter = new WritingSystemLdmlVersionGetter(); Assert.AreEqual(2, versionGetter.GetFileVersion(environment.MappedFilePath("test.ldml"))); } }
public int GetFileVersion(string fileName) { var versionReader = new WritingSystemLdmlVersionGetter(); string filePath = Path.Combine(FolderContainingLdml.Path, fileName); return versionReader.GetFileVersion(filePath); }