Ejemplo n.º 1
0
        public void RectangularPrismTest()
        {
            RectangularPrism rectangularPrism = new RectangularPrism(4, 5, 6);

            Assert.AreEqual(120, rectangularPrism.Volume);
            Assert.AreEqual(148, rectangularPrism.SurfaceArea);
            Assert.AreEqual(4, rectangularPrism.Length);
            Assert.AreEqual(5, rectangularPrism.Width);
            Assert.AreEqual(6, rectangularPrism.Height);

            RectangularPrism rectangularPrism2 = new RectangularPrism(4, 5, 6);

            Assert.AreEqual(rectangularPrism, rectangularPrism2);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(RectangularPrism other)
 {
     return other != null && (_rectangleBase == other._rectangleBase && Math.Abs(_height - other._height) < 1);
 }