Пример #1
0
        public void EnglishPrint_MultiplesSquare_CalculatedMessage()
        {
            GeometricInfoEnglish info = new GeometricInfoEnglish();
            var geometricForms        = new List <IGeometricForm>
            {
                new Square(side: 5),
                new Square(side: 1),
                new Square(side: 3)
            };
            var resumen = info.Print(geometricForms);

            Assert.AreEqual("<h1>Shapes report</h1>3 Squares | Area 35 | Perimeter 36<br/>TOTAL:<br/>3 Shapes Perimeter 36 Area 35", resumen);
        }
Пример #2
0
        public void EnglishPrint_MultiplesForms_CalculatedMessage()
        {
            GeometricInfoEnglish info = new GeometricInfoEnglish();
            var geometricForms        = new List <IGeometricForm>
            {
                new Square(side: 5),
                new Circle(diameter: 3),
                new EquilateralTriangle(side: 4),
                new Square(side: 2),
                new EquilateralTriangle(side: 9),
                new Circle(diameter: 2.75m),
                new EquilateralTriangle(side: 4.2m)
            };
            var resumen = info.Print(geometricForms);

            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);
        }
Пример #3
0
        public void EnglishPrint_EmptyList_EmptyMessage()
        {
            GeometricInfoEnglish info = new GeometricInfoEnglish();

            Assert.AreEqual("<h1>Empty list of shapes!</h1>", info.Print(new List <IGeometricForm>()));
        }