コード例 #1
0
        public void GetAllExternalLinks()
        {
            var analyserModel = new AnalyserModel();

            analyserModel.Content = "There are links for your reference, http://test.com, https://www.app.com.my";
            var analyserService = new AnalyserService(analyserModel);
            var result          = analyserService.Analysis();

            Assert.AreEqual(result.LinkList.Count, 2);
        }
コード例 #2
0
        private void UpdateSelectedAnalyser(string selectedSerial)
        {
            //The Analyser model will be null if there is no analyser match for the serial number
            AnalyserModel SelectedAnalyser = Analysers.SingleOrDefault(a => a.Serial == selectedSerial);

            if (SelectedAnalyser != null)
            {
                this.SelectedAnalyser = SelectedAnalyser.Id;
            }
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: b3kz0d/SEOAnalyser
 public ActionResult Analyser(AnalyserModel model)
 {
     try
     {
         var analyserService = new AnalyserService(model);
         var models          = analyserService.Analysis();
         return(Json(models));
     }
     catch (Exception ex)
     {
         return(new HttpStatusCodeResult(404));
     }
 }
コード例 #4
0
        public void GetAllWords()
        {
            var analyserModel = new AnalyserModel();

            analyserModel.Content         = "Filler text is text that shares some characteristics of a real written text, but is random or otherwise generated. It may be used to display a sample of fonts, generate text for testing, or to spoof an e-mail spam filter.";
            analyserModel.FilterStopWords = true;
            var analyserService = new AnalyserService(analyserModel);
            var result          = analyserService.Analysis();

            Assert.AreEqual(result.WordList["text"], 4);
            Assert.IsFalse(result.WordList.ContainsKey("that"));

            analyserModel.FilterStopWords = false;
            analyserService = new AnalyserService(analyserModel);
            result          = analyserService.Analysis();
            Assert.IsTrue(result.WordList.ContainsKey("that"));
        }
コード例 #5
0
 public UrlAnalyserService(AnalyserModel model)
 {
     _model = model;
 }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: b3kz0d/SEOAnalyser
        public ActionResult Index()
        {
            var model = new AnalyserModel();

            return(View(model));
        }
コード例 #7
0
 public TextAnalyserService(AnalyserModel model)
 {
     _model = model;
 }
コード例 #8
0
ファイル: AnalyserService.cs プロジェクト: b3kz0d/SEOAnalyser
 public AnalyserService(AnalyserModel analyserModel)
 {
     _analyserModel = analyserModel;
 }