예제 #1
0
        public void Copy_CallToCopy_ShouldReturnNewReferenceOfSameObjectType()
        {
            // Arrange
            // Act
            Proposition copy          = negation.Copy();
            bool        sameReference = negation == copy;

            // Assert
            sameReference.Should().BeFalse("Because the copy should be a different object reference");
            copy.Equals(negation).Should().BeTrue("Because the copy should have the same data");
        }
예제 #2
0
        public void Copy_CallToCopyOnConstant_ExpectedEqualsToReturnTrueAndDifferentReferences()
        {
            // Arrange
            Proposition copy = constant.Copy();

            // Act
            bool equal         = constant.Equals(copy);
            bool sameReference = constant == copy;

            // Assert
            equal.Should().BeTrue("Because it is a copy");
            sameReference.Should().BeFalse("Because it is a copy and thus should not be the same address in memory");
        }