Please check this code:
var expectedTrueButWasFalse = new Url("/xxx?x=1&y=2").Equals(new Url("/xxx?y=2&x=1"));
Logically it is same urls, but they are not equals. I think query params should be ordered by name in equality check to use it in test assertions for example. Or there should be custom method for this type of check.
"Logically it is same urls..." I disagree. Many server-side web frameworks (such as ASP.NET Core) don't care about parameter order, but there's no standard dictating that URI query strings x=1&y=2 and y=2&x=1 are equivalent.
"Or you can add extension method" I don't believe this feature is broadly useful enough to bake into the library, but it's a fine idea to add to your application if you find it useful.
Hi there!
Please check this code:
var expectedTrueButWasFalse = new Url("/xxx?x=1&y=2").Equals(new Url("/xxx?y=2&x=1"));
Logically it is same urls, but they are not equals. I think query params should be ordered by name in equality check to use it in test assertions for example. Or there should be custom method for this type of check.