AddQueryParam and AddHashParam don't work with ietf rfc

Couple of HttpUtil issues.

AddQueryParam

HttpUtils.AddQueryParam doesn’t work with hash params. The hash fragment should be at the end of the url according to https://tools.ietf.org/html/rfc3986#page-16

If a hash param exists the query param should go before it.

Here are some tests:

Assert.That("http://example.com?f=1#hash".AddQueryParam("f", "2"), Is.EqualTo("http://example.com?f=1&f=2#hash"));
Assert.That("#hash".AddQueryParam("a", "b"), Is.EqualTo("?a=b#hash"));
Assert.That("/#hash".AddQueryParam("a", "b"), Is.EqualTo("/?a=b#hash"));
Assert.That("?#hash".AddQueryParam("a", "b"), Is.EqualTo("?a=b#hash"));

AddHashParam

The hash fragment, when used for anchor bookmarks can have a null/empty value without the =, e.g. #bookmark. https://tools.ietf.org/html/rfc3986#page-16

So not sure if you want a different named extension method instead of AddHashParam or change AddHashParam to work with null/empty param values (which means removing some existing nunit tests).

Here are some tests for the hash fragment:

// This tests that a null value enters the key without the "="
Assert.That("http://example.com?f=1".AddHashParam("#hash", null), Is.EqualTo("http://example.com?f=1&f=2#hash"));

// This tests to see if the HashParam is missing the `#` prefix and if so add it.
Assert.That("http://example.com?f=1".AddHashParam("hash", null), Is.EqualTo("http://example.com?f=1&f=2#hash"));

AddQueryParam and AddHashParam only appends to the URL, it doesn’t replace or insert contents, you can use SetHashParam to replace existing params. For your valueless #hash param, just append it to the URL yourself where it’s more readable as I don’t want to change existing behavior, esp. for that which has been defined by unit tests.