GetAsUrlParameter() публичный Метод

Gets the current instance as a URL encoded value.
public GetAsUrlParameter ( ) : string
Результат string
Пример #1
0
        public void Location_with_spaces_gives_empty_url()
        {
            Location l = "    ";

            string expected = "";
            string actual   = l.GetAsUrlParameter();

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void GetAsUrlEncoded()
        {
            Location l = new Location("City Hall, New York, NY");

            string expected = "City%20Hall%2C%20New%20York%2C%20NY";
            string actual   = l.GetAsUrlParameter();

            //note, if this test starts failing, it may be because the 'comma' is being (in some circles' opinion) "properly" url encoded to %2c
            Assert.AreEqual(expected, actual);
        }