public void Parse_should_parse_expanded_names() { DomName qn = DomName.Parse("{http://ns.example.com/mushroom-kingdom} Mario"); Assert.Equal("Mario", qn.LocalName); Assert.Equal("http://ns.example.com/mushroom-kingdom", qn.NamespaceUri); }
public void Parse_should_throw_oninvalid_names() { Assert.Throws <ArgumentException>(() => { DomName.Parse("*&Ma^^rio"); }); Assert.Throws <ArgumentException>(() => { DomName.Parse("name whitespace"); }); Assert.Throws <ArgumentException>(() => { DomName.Parse(""); }); }
public void Parse_should_parse_default_ns() { DomName qn = DomName.Parse("Mario"); Assert.Equal("Mario", qn.LocalName); }
public void ToString_should_format_prefix_binding() { DomName qn = DomName.Parse("{http://ns.example.com/mushroom-kingdom} Mario").WithPrefix("mk"); Assert.Equal("mk:Mario", qn.ToString("P")); }
public void ToString_should_format_default() { DomName qn = DomName.Parse("{http://ns.example.com/mushroom-kingdom} Mario"); Assert.Equal("{http://ns.example.com/mushroom-kingdom} Mario", qn.ToString()); }
public void ToString_should_format(string expected, string format) { DomName qn = DomName.Parse("{http://ns.example.com/mushroom-kingdom} Mario"); Assert.Equal(expected, qn.ToString(format)); }