Exemple #1
0
        public void ShouldCalculateAreaForSquare()
        {
            var shapes = new [] {
                new SquareElement(2F)
            };
            var area = new AreaCalculatorVisitor(shapes)
                       .Sum();

            Assert.AreEqual(area, 4f);
        }
Exemple #2
0
        public void ShouldCalculateAreaForCircle()
        {
            var shapes = new [] {
                new CircleElement(2F)
            };
            var area = new AreaCalculatorVisitor(shapes)
                       .Sum();

            Assert.AreEqual(area, 12.566371f);
        }