Exemplo n.º 1
0
        public void TestInterfaceTrapecioRectangulo()
        {
            double[] bases = { 5, 4 };
            double[] lados = { 5, 4, 3, 3.2 };

            TrapecioRectangulo tr = new TrapecioRectangulo
            {
                Altura = 3
            };

            tr.SetBases(bases);
            tr.SetLados(lados);

            Assert.AreEqual(13.5, tr.GetArea());
            Assert.AreEqual(15.2, tr.GetPerimetro());
            Assert.AreEqual("Trapecio", tr.Tipo);
        }