Beispiel #1
0
        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);
        }
Beispiel #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(Sphere other)
 {
     return other != null && Math.Abs(_radius - other._radius) < 1;
 }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(Sphere other)
 {
     return(other != null && Math.Abs(_radius - other._radius) < 1);
 }