public void GetHtmlTest() { // recreating the function string GetHtmlTestFunc(string urlAddress) { string html; using (WebClient client = new WebClient()) { html = client.DownloadString(urlAddress); byte[] bytes = Encoding.Default.GetBytes(html); html = Encoding.UTF8.GetString(bytes); } return(html); } // checks if it is correctly getting the html from a page Assert.AreEqual(GetHtmlTestFunc("http://corndog.io/"), HtmlUtility.GetHtml("http://corndog.io//")); }