public void SphereTest() { Sphere sphere = new Sphere(4); Assert.AreEqual(4, sphere.Radius); Assert.AreEqual(268.082573, Math.Round(sphere.Volume, 6)); Assert.AreEqual(201.06193, Math.Round(sphere.SurfaceArea, 6)); Sphere sphere2 = new Sphere(4); Assert.AreEqual(sphere, sphere2); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Sphere other) { return other != null && Math.Abs(_radius - other._radius) < 1; }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Sphere other) { return(other != null && Math.Abs(_radius - other._radius) < 1); }