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); }
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; } }
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)); } }
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")); }
public UrlAnalyserService(AnalyserModel model) { _model = model; }
public ActionResult Index() { var model = new AnalyserModel(); return(View(model)); }
public TextAnalyserService(AnalyserModel model) { _model = model; }
public AnalyserService(AnalyserModel analyserModel) { _analyserModel = analyserModel; }