Exemplo n.º 1
0
        public void OverridesExistingParameter()
        {
            // Arrange
            const string URL = "http://root.com/?key=val";
            var ub = new UriBuilder(URL);

            // Act
            ub.SetQueryStringParameter("key", "value");

            // Assert
            Assert.AreEqual("http://root.com/?key=value", ub.Uri.ToString());
        }
Exemplo n.º 2
0
        public void AddsNewParameter()
        {
            // Arrange
            const string URL = "http://root.com?q=root";
            var ub = new UriBuilder(URL);

            // Act
            ub.SetQueryStringParameter("key", "value");

            // Assert
            Assert.AreEqual("http://root.com/?q=root&key=value", ub.Uri.ToString());
        }