public void before_each_test_setup() { TargetContainer = new SummarizationInformationContainer(); TargetAnalyzedDocument = new AnalyzedDocument { ScoredSentences = TargetContainer.ScoredSentences, ScoredTextUnits = TargetContainer.ScoredTextUnits }; TargetContentSummarizer = Substitute.For <IContentSummarizer>(); TargetContentSummarizer.GetConcepts(Arg.Any <AnalyzedDocument>(), Arg.Any <ISummarizerArguments>()).Returns(new List <string>() { "concept" }); TargetContentSummarizer.GetSentences(Arg.Any <AnalyzedDocument>(), Arg.Any <ISummarizerArguments>()).Returns(new List <string>() { "sentence" }); TargetSummarizerArguments = Substitute.For <ISummarizerArguments>(); }
public void throws_if_IContentSummarizer_GetSentences_returns_null() { TargetContentSummarizer.GetSentences(Arg.Any <AnalyzedDocument>(), Arg.Any <ISummarizerArguments>()).Returns((List <string>)null); Assert.That(() => Target.SummarizeAnalysedContent(TargetAnalyzedDocument, TargetContentSummarizer, TargetSummarizerArguments), Throws.TypeOf <InvalidOperationException>()); }
public void calls_IContentSummarizer_GetSentences_with_arguments_from_the_call() { Target.SummarizeAnalysedContent(TargetAnalyzedDocument, TargetContentSummarizer, TargetSummarizerArguments); TargetContentSummarizer.Received(1).GetSentences(TargetAnalyzedDocument, TargetSummarizerArguments); }
public void throws_if_IContentSummarizer_GetSentences_returns_null() { TargetContentSummarizer.GetSentences(Arg.Any <AnalyzedDocument>(), Arg.Any <ISummarizerArguments>()).Returns((List <string>)null); Target.SummarizeAnalysedContent(TargetAnalyzedDocument, TargetContentSummarizer, TargetSummarizerArguments); }