Пример #1
0
        public void RecolorFigure_WhenFigureIsRecolorNotForFirstTime_GetArgumentException()
        {
            var sidesPaperTriangle = new List <double> {
                6, 8, 6
            };

            var paperTriangle = new PaperTriangle(sidesPaperTriangle, Color.Red);

            paperTriangle.RecolorFigure(Color.Green);
            paperTriangle.RecolorFigure(Color.Black);
        }
        public void Test_RecolorFigure_ThrowsArgumentException(Type typeException, string exceptionMessage, Color colorBlue, Color colorGreen, Color colorRed)
        {
            var sidesPaperRectangle = new List <double> {
                6, 8, 6
            };

            var paperTriangle = new PaperTriangle(sidesPaperRectangle, colorBlue);

            paperTriangle.RecolorFigure(colorGreen);

            Assert.That(() => paperTriangle.RecolorFigure(colorRed), Throws.ArgumentException.With.Message.EqualTo(exceptionMessage));
        }
        public void Test_RecolorFigure(Color colorBlue, Color actualResult)
        {
            var sides = new List <double> {
                6, 8, 8
            };

            var paperTriangle = new PaperTriangle(sides, colorBlue);

            paperTriangle.RecolorFigure(actualResult);
            Color result = paperTriangle.Color;

            Assert.AreEqual(result, actualResult);
        }
Пример #4
0
        public void RecolorFigure_WhenFigureIsRecolorForFirstTime_NewColor()
        {
            var sidesPaperTriangle = new List <double> {
                6, 8, 6
            };

            var paperTriangle = new PaperTriangle(sidesPaperTriangle, Color.Red);

            paperTriangle.RecolorFigure(Color.Green);
            Color result       = paperTriangle.Color;
            Color actualResult = Color.Green;

            Assert.AreEqual(result, actualResult);
        }