public void WriteSingle() { var parts = new Dictionary<string, string[]> { { "single", new[] { "only" } } }; var query = new QueryString(parts); query.ToString() .ShouldEqual("single=only"); }
public void WriteEscaped() { var parts = new Dictionary<string, string[]> { { "escaped", new[] { "c++ < c#" } } }; var query = new QueryString(parts); query.ToString() .ShouldEqual("escaped=c%2B%2B%20%3C%20c%23"); }
public void WriteMultiple() { var parts = new Dictionary<string, string[]> { { "single", new[] { "only" } }, { "multi", new[] { "first", "second" } } }; var query = new QueryString(parts); query.ToString() .ShouldEqual("single=only&multi=first&multi=second"); }
public void WriteEmpty() { var parts = new Dictionary<string, string[]>(); var query = new QueryString(parts); query.ToString() .ShouldEqual(string.Empty); }