Example #1
0
        public void SetSize_Text_Biggest()
        {
            var data = new List<Word> { new Word("привет", 4), new Word("пока", 2), new Word("слово", 1) };
            var parser = A.Fake<IParser>();
            A.CallTo(() => parser.Parse()).Returns(data);
            var algo = new SampleAlgorithm(parser);
            var container = algo.ApplyAlgorithm();

            var expected = new Word("привет", 4);
            var actual = container.OrderBy(e => e.Size).Last();

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void SetColor_Text_MaxAlphaColor()
        {
            var data = new List<Word> { new Word("привет", 4), new Word("пока", 2), new Word("слово", 1 )};
            var parser = A.Fake<IParser>();
            A.CallTo(() => parser.Parse()).Returns(data);
            var algo = new SampleAlgorithm(parser);
            var container = algo.ApplyAlgorithm();

            var expected = 255;
            var actual = (int)container.First(e => e.Name == "привет").Color.A;

            Assert.AreEqual(expected, actual);
        }