Ejemplo n.º 1
0
        public void LookupPrefix_should_return_ns_name()
        {
            var xr = new XmlNamespaceResolver {
                { "runtime", (Xmlns.Core2008) },
                { "share", (Xmlns.ShareableCodeMetadata2011) },
            };
            var all = xr.LookupPrefix(Xmlns.Core2008);

            Assert.Equal("runtime", all);
        }
Ejemplo n.º 2
0
        public void Add_should_allow_and_apply_duplicates()
        {
            var xr = new XmlNamespaceResolver {
                { "runtime", Xmlns.Core2008 },
                { "runtime", Xmlns.Core2008 + "S" },
            };

            var all    = xr.GetNamespacesInScope(XmlNamespaceScope.Local);
            var prefix = xr.LookupPrefix(Xmlns.Core2008 + "S");

            Assert.Contains("runtime", all.Keys);
            Assert.Equal(1, all.Keys.Count);
            Assert.Equal(Xmlns.Core2008, all["runtime"]);
            Assert.Equal("runtime", prefix);
        }