Пример #1
0
        public void AreaCustomFigure_from_pointers()
        {
            var figureTools = new FigureTools();
            var areaCustom  = figureTools.Area(new CustomFigure(new Point(0, 0), new Point(0, 1), new Point(1, 0)));

            Assert.AreEqual(areaCustom, 0.5, 0.00001);
        }
Пример #2
0
        public void AreaTriangle_by_size()
        {
            var figureTools  = new FigureTools();
            var areaTriangle = figureTools.Area(new Triangle(1, 1, 1.414213562));

            Assert.AreEqual(areaTriangle, 0.5, 0.00001);
        }
Пример #3
0
        public void AreaTriangle_by_coord()
        {
            var figureTools  = new FigureTools();
            var areaTriangle = figureTools.Area(new Triangle(new Point(0, 0), new Point(0, 1), new Point(1, 0)));

            Assert.AreEqual(areaTriangle, 0.5, 0.00001);
        }
Пример #4
0
        public void AreaTriangle_ISRightTriangle_false()
        {
            var figureTools = new FigureTools();
            var triangle    = new Triangle(1, 1, 1);

            Assert.AreEqual(triangle.IsRightTriangle(), false);
        }
Пример #5
0
        public void AreaTriangle_ISRightTriangle_true()
        {
            var figureTools = new FigureTools();
            var triangle    = new Triangle(new Point(0, 0), new Point(0, 1), new Point(1, 0));

            Assert.AreEqual(triangle.IsRightTriangle(), true);
        }
Пример #6
0
        public void AreaCircle_by_radius()
        {
            var figureTools = new FigureTools();
            var areaCircle  = figureTools.Area(new Circle(1));

            Assert.AreEqual(areaCircle, System.Math.PI, 0.00001);
        }