public void RemoveQueryParamTest() { UriBuilder uriBuilder = new UriBuilder("http://", "mccoysoftware.uk"); uriBuilder.Query = "Title=Mr&FirstName=Arthur&Surname=Dent"; // First assert we know the starting string Assert.AreEqual("http://mccoysoftware.uk/?Title=Mr&FirstName=Arthur&Surname=Dent", uriBuilder.ToString()); // Now assert we can remove a parameter (from the middle) uriBuilder.RemoveQueryParam("FirstName"); Assert.AreEqual("http://mccoysoftware.uk/?Title=Mr&Surname=Dent", uriBuilder.ToString()); }