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)); }
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)); }
public void FrequencyAlgorithm_Should_ReturnBlack_NoCurrentWordInDictionary() { var algorithm = new FrequencyColorAlgorithm(); algorithm.GetColor(new Dictionary <string, int>(), "aaa").Should().BeEquivalentTo(Color.Black); }
public void FrequencyAlgorithm_Should_ReturnBlack_NoWords() { var algorithm = new FrequencyColorAlgorithm(); algorithm.GetColor().Should().BeEquivalentTo(Color.Black); }