public bool Equals(QuantifierFormula other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Quantifier.Equals(other.Quantifier) &&
            ObjectVariable.Equals(other.ObjectVariable) &&
            SubFormula.Equals(other.SubFormula));
 }
Пример #2
0
        public void Copy_CopyQuantifier_ExpectedEqualsToBeTrueButDifferentReferences()
        {
            // Arrange
            Quantifier quantifier = GetQuantifier();

            quantifier.LeftSuccessor = PropositionGenerator.GetRandomProposition();

            // Act
            Proposition copy          = quantifier.Copy();
            bool        equal         = quantifier.Equals(copy);
            bool        sameReference = quantifier == copy;

            // Assert
            equal.Should().BeTrue("Because the quantifier is copied");
            sameReference.Should().BeFalse("Since copies should be different references");
        }