示例#1
0
        public void IsUrlValid_ValidUrl_ReturnTrue()
        {
            _testObject = new WebPageAdapter();
            var isUrlValid = _testObject.IsUrlValid(ValidUrl);

            Assert.IsTrue(isUrlValid);
        }
示例#2
0
        public void IsUrlValid_InvalidUrl_ReturnFalse()
        {
            _testObject = new WebPageAdapter();
            var isUrlValid = _testObject.IsUrlValid(InvalidUrl);

            Assert.IsFalse(isUrlValid);
        }
示例#3
0
        /// <summary>
        /// Analyze webpage content.
        /// Fills grid view.
        /// </summary>
        private void Analyze()
        {
            SetControls(true);

            if (_webPageAdapter.IsUrlValid(WebPageAddress))
            {
                var keywords = GetKeywordsFromWebpage();
                GetOccurrencesOfKeywordsInWebpage(keywords);
                FillKeywordsGridView();
            }
            else
            {
                MessageBox.Show(TextResources.WebpageKeywordsFinderResources.MsgInvalidUrl);
            }

            SetControls(false);
        }