Esempio n. 1
0
        public void HashCodesMatched_ValidExpressionWithVariablesOnlyGiven_ExpectedTrueReturned(string propositionExpression)
        {
            // Arrange
            logicApp.Parse(propositionExpression);

            // Act
            bool actualHashCodesMatchedUp = logicApp.HashCodesMatched();

            // Assert
            actualHashCodesMatchedUp.Should().BeTrue("Because all hash codes should match up in since every proposition would be logically equivalent");
        }
        public void GenerateExpression_RandomExpressionGeneratedAndPassedToLogicAppForParsing_ExpectedAllHashCodesToMatch()
        {
            // Arrange
            // re-use logic app for not repeating large procedure and for all the hash codes.
            LogicApp             logicApp             = new LogicApp(new Parser());
            PropositionGenerator propositionGenerator = new PropositionGenerator();

            // Act
            Proposition randomExpression = propositionGenerator.GenerateExpression();

            logicApp.Parse(randomExpression);

            bool hashCodesMatched = logicApp.HashCodesMatched();

            // Assert
            hashCodesMatched.Should().BeTrue("Because a valid expression should be generated");
        }