Esempio n. 1
0
            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>();
            }
Esempio n. 2
0
 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>());
 }
Esempio n. 3
0
 public void calls_IContentSummarizer_GetSentences_with_arguments_from_the_call()
 {
     Target.SummarizeAnalysedContent(TargetAnalyzedDocument, TargetContentSummarizer, TargetSummarizerArguments);
     TargetContentSummarizer.Received(1).GetSentences(TargetAnalyzedDocument, TargetSummarizerArguments);
 }
Esempio n. 4
0
 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);
 }