public void LdmlTooComplexForSimpleRules_ReturnsFalse()
        {
            _collationXml = "<rules><reset before=\"primary\"><first_non_ignorable /></reset><p>A</p>"
                            + "<x><t>B</t><extend>C</extend></x></rules>";
            string simple;

            Assert.IsFalse(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
        }
        public void CharacterEscapedForIcu_NotEscapedInSimpleRules()
        {
            _collationXml = "<rules><reset before=\"primary\"><first_non_ignorable /></reset><p>=</p><p>b</p></rules>";
            string simple;

            Assert.IsTrue(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
            Assert.AreEqual("=\r\nb", simple);
        }
        public void ConcatenatedTertiaryDifferences_ProduceCorrectSimpleRules()
        {
            _collationXml = "<rules><reset before=\"primary\"><first_non_ignorable /></reset><p>a</p><tc>bcd</tc></rules>";
            string simple;

            Assert.IsTrue(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
            Assert.AreEqual("(a b c d)", simple);
        }
        public void SecondaryDifference_ProducesCorrectSimpleRules()
        {
            _collationXml = "<rules><reset before=\"primary\"><first_non_ignorable /></reset><p>a</p><s>b</s></rules>";
            string simple;

            Assert.IsTrue(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
            Assert.AreEqual("a b", simple);
        }
        public void WhiteSpace_IsIgnored()
        {
            _collationXml = "<rules>\r\n<reset before=\"primary\">\r\n<first_non_ignorable />\r\n</reset>\r\n<p>a</p>\r\n<sc>bcd</sc>\r\n</rules>";
            string simple;

            Assert.IsTrue(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
            Assert.AreEqual("a b c d", simple);
        }
        public void Reset_ProducesEmptySimpleRules()
        {
            _collationXml = "<rules><reset before=\"primary\"><first_non_ignorable /></reset></rules>";
            string simple;

            Assert.IsTrue(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
            Assert.AreEqual(string.Empty, simple);
        }
        public void LotsOLdmlCollation_ProducesCorrectSimpleRules()
        {
            _collationXml = "<rules><reset before=\"primary\"><first_non_ignorable /></reset><p>a</p><sc>bc</sc>"
                            + "<s>d</s><pc>efg</pc><t>h</t><tc>ijk</tc><p>l</p></rules>";
            string simple;

            Assert.IsTrue(LdmlCollationParser.TryGetSimpleRulesFromCollationNode(_collationXml, out simple));
            Assert.AreEqual("a b c d\r\ne\r\nf\r\n(g h i j k)\r\nl", simple);
        }