示例#1
0
        public void GetPaintedWords_PaintsWords()
        {
            var layoutedWords = new LayoutedWord[3];

            layoutedWords[0] = new LayoutedWord("test", new Rectangle(0, 0, 10, 10));
            layoutedWords[1] = new LayoutedWord("test1", new Rectangle(17, 37, 10, 10));
            layoutedWords[2] = new LayoutedWord("test2", new Rectangle(48, 56, 10, 10));
            var statDict = new Dictionary <WordStatistics.WordStatistics, int>
            {
                [new WordStatistics.WordStatistics(layoutedWords[0], StatisticsType.WordCount)] = 2,
                [new WordStatistics.WordStatistics(layoutedWords[0], StatisticsType.WordCount)] = 4,
                [new WordStatistics.WordStatistics(layoutedWords[0], StatisticsType.WordCount)] = 8
            };
            var text = new AnalyzedLayoutedText(layoutedWords, statDict);

            foreach (var paintedWord in wordPainter.GetPaintedWords(text))
            {
                paintedWord.FontColor.Should().NotBe(default(Color));
            }
        }
示例#2
0
 public int GetStat(LayoutedWord word, StatisticsType type)
 {
     return(statistics[new WordStatistics.WordStatistics(word, type)]);
 }