public void GetRandomPropositionSymbol_CallToGetRandomPropositionSymbol_ExpectedRandomPropositionReturned()
        {
            // Arrange // Act
            Proposition randomProposition = PropositionGenerator.GetRandomPropositionSymbol();

            // Assert
            randomProposition.Should().BeOfType <Proposition>("Because a proposition with a random variable letter is generated");
        }
Example #2
0
        public void Nandify_CallToNandifyOnValidRandomVariable_ExpectedNandifiedPropositionReturned()
        {
            // Arrange
            Proposition validProposition = PropositionGenerator.GetRandomPropositionSymbol();

            // Act
            Proposition nandifiedProposition = validProposition.Nandify();

            // Assert
            NandChecker.hasNandStructure(new List <Proposition>()
            {
                nandifiedProposition
            });
        }
Example #3
0
        public void GetVariables_CallGetVariablesOnARandomValidProposition_ExpectedListReturnedWithTheVariableAsIndividualElement()
        {
            // Arrange
            Proposition validProposition = PropositionGenerator.GetRandomPropositionSymbol();

            int expectedNumberOfElements = 1;

            // Act
            List <Proposition> propositionVariables = validProposition.GetVariables();

            // Assert
            propositionVariables.Count.Should().Be(expectedNumberOfElements, "because the proposition variable is an individual variable");
            propositionVariables[0].Should().BeEquivalentTo(validProposition, "because the proposition variable itself is the actual proposition");
        }
Example #4
0
 public NegationTests()
 {
     negation = new Negation();
     negation.LeftSuccessor = PropositionGenerator.GetRandomPropositionSymbol();
 }