Esempio n. 1
0
 public void SaveDefinition_WritingSystemCameFromValidRfc5646WritingSystemStartingWithX_FileNameIsChanged()
 {
     using (var environment = new TestEnvironment())
     {
         var pathToFlexprivateUseLdml = Path.Combine(environment.TestPath, "x-Zxxx-x-audio.ldml");
         File.WriteAllText(pathToFlexprivateUseLdml, LdmlContentForTests.Version2("xh", "", "", ""));
         environment.Collection = new LdmlInFolderWritingSystemRepository(environment.TestPath);
         Assert.That(File.Exists(Path.Combine(environment.TestPath, "xh.ldml")));
     }
 }
Esempio n. 2
0
            public void WriteVersion2LdmlFile(string language)
            {
                string folderPath = Path.Combine(Platform.IsLinux ? GlobalWritingSystemRepositoryMigrator.LdmlPathLinuxVersion2 : _baseFolder.Path, "2");

                Directory.CreateDirectory(folderPath);
                string filePath = Path.Combine(folderPath, String.Format("{0}.ldml", language));
                string content  = LdmlContentForTests.Version2(language, "", "", "");

                File.WriteAllText(filePath, content);
            }
Esempio n. 3
0
 public void CorrectlyReturnsDefaultBranchNameOnLdml2Files()
 {
     using (var liftProject = new TemporaryFolder("TempProj_LIFT"))
         using (var liftFile = new TempFileFromFolder(liftProject, "proj.lift", TestLift13File))
         {
             var wsDirectory = Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(liftFile.Path), "WritingSystems"));
             using (var writingSystemsDir =
                        TempFileFromFolder.CreateAt(liftProject.Combine("WritingSystems", "lang.ldml"), LdmlContentForTests.Version2("en", "", "", "")))
             {
                 var syncAdjunct = new LiftSynchronizerAdjunct(liftFile.Path);
                 Assert.AreEqual("default", syncAdjunct.BranchName, "BranchName should be 'default' with version 2 ldml files");
             }
         }
 }