/// <summary> /// Checks to see if "_squareBase".Length is equal to "other"._squareBase.Length /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Cube other) { if (other == null) { return false; } return Math.Abs(_squareBase.Length - other._squareBase.Length) < 1; }
public void CubeTest() { Cube cube = new Cube(3); Assert.AreEqual(27, cube.Volume); Assert.AreEqual(54, cube.SurfaceArea); Assert.AreEqual(3, cube.Length); Cube cube2 = new Cube(3); Assert.AreEqual(cube, cube2); }