public void before_each_test_setup() { TargetContainer = new SummarizationInformationContainer(); TargetParsedDocument = new ParsedDocument(); TargetParsedDocument.Sentences = new List <Sentence>() { TargetContainer.Sentence }; TargetContentAnalyzer = Substitute.For <IContentAnalyzer>(); TargetContentAnalyzer.GetImportantTextUnits(Arg.Any <List <Sentence> >()).Returns(TargetContainer.ScoredTextUnits); TargetContentAnalyzer.ScoreSentences(Arg.Any <List <Sentence> >(), Arg.Any <List <TextUnitScore> >()).Returns(TargetContainer.ScoredSentences); }
public void calls_IContentAnalyzer_ScoreSentences_with_parsed_document_sentences_and_returning_scored_text_units() { Target.AnalyzeParsedContent(TargetParsedDocument, TargetContentAnalyzer); TargetContentAnalyzer.Received(1).ScoreSentences(TargetParsedDocument.Sentences, TargetContainer.ScoredTextUnits); }
public void calls_IContentAnalyzer_GetImportantTextUnits_with_parsed_document_sentences() { Target.AnalyzeParsedContent(TargetParsedDocument, TargetContentAnalyzer); TargetContentAnalyzer.Received(1).GetImportantTextUnits(TargetParsedDocument.Sentences); }
public void throws_if_IContentAnalyzer_ScoreSentences_returns_null() { TargetContentAnalyzer.ScoreSentences(Arg.Any <List <Sentence> >(), Arg.Any <List <TextUnitScore> >()).Returns((List <SentenceScore>)null); Assert.That(() => Target.AnalyzeParsedContent(TargetParsedDocument, TargetContentAnalyzer), Throws.TypeOf <InvalidOperationException>()); }
public void throws_if_IContentAnalyzer_ScoreSentences_returns_null() { TargetContentAnalyzer.ScoreSentences(Arg.Any <List <Sentence> >(), Arg.Any <List <TextUnitScore> >()).Returns((List <SentenceScore>)null); Target.AnalyzeParsedContent(TargetParsedDocument, TargetContentAnalyzer); }