Beispiel #1
0
        public void ParallelogramTest()
        {
            Parallelogram parallelogram = new Parallelogram(4, 5);

            Assert.AreEqual(20, parallelogram.Area);
            Assert.AreEqual(4, parallelogram.Length);
            Assert.AreEqual(5, parallelogram.Height);
            Assert.AreEqual(18, parallelogram.Perimeter);

            Parallelogram parallelogram2 = new Parallelogram(4, 5);

            Assert.AreEqual(parallelogram, parallelogram2);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(Parallelogram other)
 {
     return other != null && (Math.Abs(_length - other._length) < 1 && Math.Abs(_height - other._height) < 1);
 }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(Parallelogram other)
 {
     return(other != null && (Math.Abs(_length - other._length) < 1 && Math.Abs(_height - other._height) < 1));
 }