public void WritingSystemLdmlVersionGetterGetFileVersion_FileIsVersion1_Returns1() { using (_environment = new TestEnvironment()) { _environment.WriteContentToWritingSystemLdmlFile(LdmlContentForTests.Version1("en", "", "", "")); var versionGetter = new WritingSystemLdmlVersionGetter(); Assert.That(versionGetter.GetFileVersion(_environment.PathToWritingSystemLdmlFile), Is.EqualTo(1)); } }
public void WriteVersion1LdmlFile(string language) { string folderPath = Path.Combine(Platform.IsLinux ? GlobalWritingSystemRepositoryMigrator.LdmlPathLinuxVersion2 : _baseFolder.Path, "1"); Directory.CreateDirectory(folderPath); string filePath = Path.Combine(folderPath, String.Format("{0}.ldml", language)); string content = LdmlContentForTests.Version1(language, "", "", ""); File.WriteAllText(filePath, content); }
public void GetFileVersion_V1_ReturnsBadVersion() { string xml = LdmlContentForTests.Version1("en", "", "", ""); using (var file = new TempFile(xml)) { var silLdmlVersion = new SilLdmlVersion(); int result = silLdmlVersion.GetFileVersion(file.Path); Assert.That(result, Is.EqualTo(SilLdmlVersion.BadVersion)); } }