示例#1
0
        public void SquarePyramidTest()
        {
            SquarePyramid squarePyramid = new SquarePyramid(5, 6);

            Assert.AreEqual(5, squarePyramid.Length);
            Assert.AreEqual(6, squarePyramid.Height);
            Assert.AreEqual(50, squarePyramid.Volume);
            Assert.AreEqual(90, squarePyramid.SurfaceArea);

            SquarePyramid squarePyramid2 = new SquarePyramid(5, 6);

            Assert.AreEqual(squarePyramid, squarePyramid2);
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(SquarePyramid other)
 {
     return(other != null && (_squareBase == other._squareBase && Math.Abs(_height - other._height) < 1));
 }
示例#3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(SquarePyramid other)
 {
     return other != null && (_squareBase == other._squareBase && Math.Abs(_height - other._height) < 1);
 }