/// <summary>
 /// Static constructor required so static fields are always initialized
 /// </summary>
 static TrueFalseValue()
 {
     TrueFalseValue.Unanswered = new TrueFalseValue();
     TrueFalseValue.UnansweredLocked = new TrueFalseValue(null, false);
     TrueFalseValue.True = new TrueFalseValue(true);
     TrueFalseValue.False = new TrueFalseValue(false);
 }
        public void UnansEquals3()
        {
            TrueFalseValue uv1 = new TrueFalseValue();
            TrueFalseValue uv2 = new TrueFalseValue();

            uv1.Equals(uv2);
        }
        public void UnansEquals1()
        {
            TrueFalseValue v = new TrueFalseValue(true);
            TrueFalseValue uv = new TrueFalseValue();

            uv.Equals(v);
        }
        public void UnansEquals2()
        {
            TrueFalseValue v = new TrueFalseValue(false);
            TrueFalseValue uv = new TrueFalseValue();

            v.Equals(uv);
        }
        public void Equals()
        {
            TrueFalseValue v1 = new TrueFalseValue(true);

            Assert.IsTrue(v1.Equals(new TrueFalseValue(true)));
            Assert.IsFalse(v1.Equals(new TrueFalseValue(false)));
        }
 /// <summary>
 /// Static constructor required so static fields are always initialized
 /// </summary>
 static TrueFalseValue()
 {
     TrueFalseValue.Unanswered       = new TrueFalseValue();
     TrueFalseValue.UnansweredLocked = new TrueFalseValue(null, false);
     TrueFalseValue.True             = new TrueFalseValue(true);
     TrueFalseValue.False            = new TrueFalseValue(false);
 }
        public int CompareTo(object obj)
        {
            if (!(obj is TrueFalseValue))
            {
                return(-1);
            }

            TrueFalseValue trueFalseValue = (TrueFalseValue)obj;

            if (!IsAnswered && !trueFalseValue.IsAnswered)
            {
                return(0);
            }
            if (!IsAnswered)
            {
                return(1);
            }
            if (!trueFalseValue.IsAnswered)
            {
                return(-1);
            }

            if (Value == trueFalseValue.Value)
            {
                return(0);
            }
            return(Value ? -1 : 1);
        }
        private bool Equals(TrueFalseValue operand)
        {
            if (!IsAnswered || !operand.IsAnswered)
            {
                throw new InvalidOperationException();
            }

            return(Value.Equals(operand.Value));
        }
        private bool Equals(TrueFalseValue operand)
        {
            if (!IsAnswered || !operand.IsAnswered)
                throw new InvalidOperationException();

            return Value.Equals(operand.Value);
        }
 public void IsAnswered()
 {
     TrueFalseValue v = new TrueFalseValue();
     Assert.IsFalse(v.IsAnswered);
 }