Ejemplo n.º 1
0
        public void BuildSearchUrl_should_not_encode_unicode_characters()
        {
            OpenSearchItem item       = new OpenSearchItem("test", "test", "http://www.google.com?q={searchTerms}");
            string         searchTerm = "日本語";
            string         searchUrl  = item.BuildSearchUrl(searchTerm);
            bool           containsUnencodedUnicodeCharacters = searchUrl.Contains(searchTerm);

            Assert.IsTrue(containsUnencodedUnicodeCharacters);
        }
Ejemplo n.º 2
0
        public void BuildSearchUrl_should_encode_single_quotes()
        {
            OpenSearchItem item       = new OpenSearchItem("test", "test", "http://www.google.com?q={searchTerms}");
            string         searchTerm = "it's";
            string         searchUrl  = item.BuildSearchUrl(searchTerm);
            bool           containsUnencodedSingleQuotes = searchUrl.Contains(searchTerm);

            Assert.IsFalse(containsUnencodedSingleQuotes);
        }