public void TrapezoidTest() { Trapezoid trapezoid = new Trapezoid(5, 6, 7); Assert.AreEqual(5, trapezoid.BaseOne); Assert.AreEqual(6, trapezoid.BaseTwo); Assert.AreEqual(7, trapezoid.Height); Assert.AreEqual(38.5, trapezoid.Area); Trapezoid trapezoid2 = new Trapezoid(5, 6, 7); Assert.AreEqual(trapezoid, trapezoid2); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Trapezoid other) { return(other != null && (Math.Abs(_baseOne - other._baseOne) < 1 && Math.Abs(_baseTwo - other._baseTwo) < 1 && Math.Abs(_height - other._height) < 1)); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Trapezoid other) { return other != null && (Math.Abs(_baseOne - other._baseOne) < 1 && Math.Abs(_baseTwo - other._baseTwo) < 1 && Math.Abs(_height - other._height) < 1); }