public void SetUp()
        {
            cloudOptions = DefaultCloudOptions;

            randomWords = Enumerable.Range(0, 50)
                          .Select(wordNumber => TestsHelper.GetRandomString((wordNumber / 10 + 1) * 2,
                                                                            TestContext.CurrentContext.Random))
                          .ToArray();
            excludedWords = randomWords.Where(word => word.Length <= 2);

            vocabularyParser = A.Fake <ICloudVocabularyParser>();

            A.CallTo(() => vocabularyParser.GetCloudVocabulary(DefaultCloudOptions.CloudVocabularyFilename))
            .Returns(randomWords.AsEnumerable().AsResult());
            A.CallTo(() => vocabularyParser.GetCloudVocabulary(
                         DefaultCloudOptions.ExcludedWordsVocabularyFilename))
            .Returns(excludedWords.AsEnumerable().AsResult());

            contextGenerator = new CloudContextGenerator(cloudOptions, vocabularyParser);
            cloudGenerator   = new CloudGenerator(contextGenerator, PreprocessorConstructor);
        }
Exemple #2
0
 public CloudGenerator(ICloudContextGenerator cloudContextGenerator,
                       Func <TagCloudContext, CloudVocabularyPreprocessor> vocabularyPreprocessorConstructor)
 {
     this.cloudContextGenerator             = cloudContextGenerator;
     this.vocabularyPreprocessorConstructor = vocabularyPreprocessorConstructor;
 }