示例#1
0
        public void FrequencyAlgorithm_Should_ReturnBlack_OneWordInDictionary()
        {
            var algorithm = new FrequencyColorAlgorithm();
            var words     = new Dictionary <string, int>()
            {
                { "aaa", 1 }
            };

            algorithm.GetColor(words, "aaa").Should().BeEquivalentTo(Color.FromArgb(0, 0, 0));
        }
示例#2
0
        public void FrequencyAlgorithm_Should_ReturnGray_TwoWordsInDictionary()
        {
            var algorithm = new FrequencyColorAlgorithm();
            var words     = new Dictionary <string, int>()
            {
                { "aaa", 1 },
                { "aab", 2 }
            };
            var hue = 255 - (int)(255 / 2);

            algorithm.GetColor(words, "aaa").Should().BeEquivalentTo(Color.FromArgb(hue, hue, hue));
        }
示例#3
0
        public void FrequencyAlgorithm_Should_ReturnBlack_NoCurrentWordInDictionary()
        {
            var algorithm = new FrequencyColorAlgorithm();

            algorithm.GetColor(new Dictionary <string, int>(), "aaa").Should().BeEquivalentTo(Color.Black);
        }
示例#4
0
        public void FrequencyAlgorithm_Should_ReturnBlack_NoWords()
        {
            var algorithm = new FrequencyColorAlgorithm();

            algorithm.GetColor().Should().BeEquivalentTo(Color.Black);
        }