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); }
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); }