示例#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_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);
        }
示例#3
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);
        }
示例#4
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);
        }