public void UnansEquals3()
        {
            DateValue uv1 = new DateValue();
            DateValue uv2 = new DateValue();

            uv1.Equals(uv2);
        }
        public void UnansEquals2()
        {
            DateValue v = new DateValue(1961, 6, 6);
            DateValue uv = new DateValue();

            v.Equals(uv);
        }
        public void UnansEquals1()
        {
            DateValue v = new DateValue(1961, 6, 6);
            DateValue uv = new DateValue();

            uv.Equals(v);
        }
        public void Equals()
        {
            DateValue v = new DateValue(1961, 6, 6);

            Assert.IsTrue(v.Equals(new DateValue(1961, 6, 6)));
            Assert.IsFalse(v.Equals(new DateValue(1961, 6, 5)));
        }
Example #5
0
        /// <summary>
        /// Indicates if the DateValue is equal to another value.
        /// </summary>
        /// <param name="operand">The value to compare the DateValue to.</param>
        /// <returns>A value indicating if the two values are equal or not.</returns>
        private bool Equals(DateValue operand)
        {
            if (!IsAnswered || !operand.IsAnswered)
                throw new InvalidOperationException();

            return Value.Equals(operand.Value);
        }
Example #6
0
 /// <summary>
 /// Static constructor required so static fields are always initialized
 /// </summary>
 static DateValue()
 {
     DateValue.Unanswered = new DateValue();
     DateValue.UnansweredLocked = new DateValue(null, false);
 }
 public void IsAnswered()
 {
     DateValue v = new DateValue();
     Assert.IsFalse(v.IsAnswered);
 }
 /// <summary>
 /// Static constructor required so static fields are always initialized
 /// </summary>
 static DateValue()
 {
     DateValue.Unanswered       = new DateValue();
     DateValue.UnansweredLocked = new DateValue(null, false);
 }