예제 #1
0
        public void TestResumenListaConMasTiposEnCastellano()
        {
            var formas = new ResumenListaBuilder().FormasGeometricaVarias(new List <FormaGeometrica>
            {
                new CuadradoBuilder().Build(),
                new CirculoBuilder().Build(),
                new TrianguloEquilateroBuilder().Build(),
                new CuadradoBuilder().ConCuadradoDeLado(2).Build(),
                new TrianguloEquilateroBuilder().ConTrianguloDeLado(9).Build(),
                new CirculoBuilder().ConCirculoDeLado(2.75m).Build(),
                new TrianguloEquilateroBuilder().ConTrianguloDeLado(4.2m).Build()
            }).Build();

            var resumen = FormaGeometrica.Imprimir(formas, new Castellano());

            Assert.AreEqual(
                "<h1>Reporte de Formas</h1>2 Cuadrados | Area 29 | Perimetro 28 <br/>2 Círculos | Area 13,01 | Perimetro 18,06 <br/>3 Triángulos | Area 49,64 | Perimetro 51,6 <br/>TOTAL:<br/>7 formas Perimetro 97,66 Area 91,65",
                resumen);
        }
예제 #2
0
        public void TestResumenListaConMasTipos()
        {
            var formas = new ResumenListaBuilder().FormasGeometricaVarias(new List <FormaGeometrica>
            {
                new CuadradoBuilder().Build(),
                new CirculoBuilder().Build(),
                new TrianguloEquilateroBuilder().Build(),
                new CuadradoBuilder().ConCuadradoDeLado(2).Build(),
                new TrianguloEquilateroBuilder().ConTrianguloDeLado(9).Build(),
                new CirculoBuilder().ConCirculoDeLado(2.75m).Build(),
                new TrianguloEquilateroBuilder().ConTrianguloDeLado(4.2m).Build()
            }).Build();

            var resumen = FormaGeometrica.Imprimir(formas, new Ingles());

            Assert.AreEqual(
                "<h1>Shapes report</h1>2 Squares | Area 29 | Perimeter 28 <br/>2 Circles | Area 13,01 | Perimeter 18,06 <br/>3 Triangles | Area 49,64 | Perimeter 51,6 <br/>TOTAL:<br/>7 shapes Perimeter 97,66 Area 91,65",
                resumen);
        }