Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public void GetNamespacesInScope_should_contain_all_xmlns()
        {
            var xr = new XmlNamespaceResolver {
                { "runtime", (Xmlns.Core2008) },
                { "share", (Xmlns.ShareableCodeMetadata2011) },
            };

            var all = xr.GetNamespacesInScope(XmlNamespaceScope.Local);

            Assert.Equal(2, all.Count);
            Assert.Contains("runtime", all.Keys);
            Assert.Equal(Xmlns.Core2008, all["runtime"]);
            Assert.Contains("share", all.Keys);
            Assert.Equal(Xmlns.ShareableCodeMetadata2011, all["share"]);
        }