public override string ToString() { return string.Join(" ", _attributes.OrderBy(x => x.Key).Select(x => string.Format("{0}=\"{1}\"", x.Key, x.Value))); }
public void CreateFromAnonymousObject() { var attributes = new HtmlAttributes(new { text = "some text", num = 123 }); Assert.AreEqual("num=\"123\" text=\"some text\"", attributes.ToString()); }