コード例 #1
0
        public void EqualTo_DifferentTruthTableRowsInSize_ShouldReturnFalse()
        {
            const int SIZE_ONE = 2;
            const int SIZE_TWO = 4;

            // Arrange
            TruthTableRow ttrOne = GenerateTruthTableRowWithXPropositionVariables(SIZE_ONE);
            TruthTableRow ttrTwo = GenerateTruthTableRowWithXPropositionVariables(SIZE_TWO);

            // Act
            bool areEqual = ttrOne.EqualTo(ttrTwo);

            // Assert
            areEqual.Should().BeFalse("Because the size of the two arrays differs (equivalently the number of variables)");
        }
コード例 #2
0
        public void EqualTo_EquivalentTruthTableRows_ShouldReturnTrue()
        {
            const int SIZE_ONE = 3;
            const int SIZE_TWO = 3;

            // Arrange
            TruthTableRow ttrOne = GenerateTruthTableRowWithXPropositionVariables(SIZE_ONE);
            TruthTableRow ttrTwo = GenerateTruthTableRowWithXPropositionVariables(SIZE_TWO);

            setCellValues(ttrOne, ttrTwo, SetToEquivalentValues);

            // Act
            bool areEqual = ttrOne.EqualTo(ttrTwo);

            // Assert
            areEqual.Should().BeTrue("Because they are of equal size and have identical values in each cell");
        }
コード例 #3
0
        public void EqualTo_DifferentTruthTableRowsSameSize_ShouldReturnFalse()
        {
            const int SIZE_ONE = 3;
            const int SIZE_TWO = 3;

            // Arrange
            TruthTableRow ttrOne = GenerateTruthTableRowWithXPropositionVariables(SIZE_ONE);
            TruthTableRow ttrTwo = GenerateTruthTableRowWithXPropositionVariables(SIZE_TWO);

            setCellValues(ttrOne, ttrTwo, SetToDifferingValues);

            // Act
            bool areEqual = ttrOne.EqualTo(ttrTwo);

            // Assert
            areEqual.Should().BeFalse("Because the cells in the truth table rows have differing values");
        }