public void LoadConentTest() { // Arrange var ruleFinancialUrl = "http://rulefinancial.com"; // Act var urLoader = new UrlLoader(); var content = urLoader.LoadContent(ruleFinancialUrl); content = content.ToUpper(); // Assert Assert.IsNotNull(content); Assert.IsTrue(content.Contains(htmlDeclaration.ToUpper())); Assert.IsTrue(content.Contains(ruleSiteContent.ToUpper())); }
public void LoadConentFailsTest() { // Arrange var notValidUrl = "not valid url"; Exception exception = null; // Act try { var urLoader = new UrlLoader(); var content = urLoader.LoadContent(notValidUrl); } catch (Exception ex) { exception = ex; } // Assert Assert.IsNotNull(exception); Assert.IsTrue(exception is UriFormatException); }