public void VernacularNameOfFw83RevTest()
        {
            var projInfo = new PublicationInformation {
                DefaultXhtmlFileWithPath = _testFiles.Input("FlexRev83.xhtml"), IsLexiconSectionExist = false
            };
            var input = new DictionaryForMIDsInput(projInfo);

            Assert.AreEqual("English", input.VernacularName());
        }
        public void VernacularNameFw83Test()
        {
            var projInfo = new PublicationInformation {
                DefaultXhtmlFileWithPath = _testFiles.Input("w1.xhtml"), IsLexiconSectionExist = true
            };
            var input = new DictionaryForMIDsInput(projInfo);

            Assert.AreEqual("Buang, Mapos", input.VernacularName());
        }
Example #3
0
        public void VernacularNameTest()
        {
            const string sKey        = @"Software\SIL\Pathway";
            const string keyName     = "WritingSystemStore";
            var          lgFullPath  = _testFiles.Output("seh.ldml");
            var          lgDirectory = Path.GetDirectoryName(lgFullPath);

            Debug.Assert(!string.IsNullOrEmpty(lgDirectory));
            RegistryKey oKey  = Registry.CurrentUser.OpenSubKey(sKey, true);
            RegistryKey myKey = oKey ?? Registry.CurrentUser.CreateSubKey(sKey);

            Debug.Assert(myKey != null);
            var oVal = (oKey == null) ? null : oKey.GetValue(keyName, null);

            myKey.SetValue(keyName, lgDirectory);
            var wr = new StreamWriter(lgFullPath);

            wr.Write(@"<?xml version=""1.0"" encoding=""utf-8""?>
                <ldml><special xmlns:palaso=""urn://palaso.org/ldmlExtensions/v1"">
                        <palaso:languageName value=""Sena"" />
                </special></ldml>");
            wr.Close();
            PublicationInformation projInfo = new PublicationInformation();

            projInfo.DefaultXhtmlFileWithPath = _testFiles.Input("sena3-imba.xhtml");
            projInfo.IsLexiconSectionExist    = true;
            var input  = new DictionaryForMIDsInput(projInfo);
            var result = input.VernacularName();

            if (oKey == null)
            {
                Registry.CurrentUser.DeleteSubKey(sKey);
            }
            else if (oVal == null)
            {
                oKey.DeleteValue(keyName);
            }
            else
            {
                oKey.SetValue(keyName, oVal);
            }
            Assert.AreEqual("Sena", result);
        }