示例#1
0
        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()));
        }
示例#2
0
        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);
        }