コード例 #1
0
        public void UnansEquals3()
        {
            DateValue uv1 = new DateValue();
            DateValue uv2 = new DateValue();

            uv1.Equals(uv2);
        }
コード例 #2
0
        public void UnansEquals2()
        {
            DateValue v = new DateValue(1961, 6, 6);
            DateValue uv = new DateValue();

            v.Equals(uv);
        }
コード例 #3
0
        public void UnansEquals1()
        {
            DateValue v = new DateValue(1961, 6, 6);
            DateValue uv = new DateValue();

            uv.Equals(v);
        }
コード例 #4
0
        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)));
        }
コード例 #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);
        }
コード例 #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);
 }
コード例 #7
0
 public void IsAnswered()
 {
     DateValue v = new DateValue();
     Assert.IsFalse(v.IsAnswered);
 }
コード例 #8
0
 /// <summary>
 /// Static constructor required so static fields are always initialized
 /// </summary>
 static DateValue()
 {
     DateValue.Unanswered       = new DateValue();
     DateValue.UnansweredLocked = new DateValue(null, false);
 }