public void SimpleFlatten()
        {
            Conjunction conj  = new Conjunction(A, B);
            Conjunction conj1 = new Conjunction(C, conj);

            Conjunction expected = new Conjunction(C, A, B);
            Conjunction actual   = ((Conjunction)conj1.Flatten());

            Assert.Equal(expected, actual);
        }
        public void MultiNestedMultiOperatorFlatten()
        {
            Conjunction conj1 = new Conjunction(A, B);
            Disjunction disj1 = new Disjunction(C, D);
            Disjunction disj2 = new Disjunction(disj1, E);
            Conjunction conj2 = new Conjunction(conj1, disj2);

            Conjunction       expected = new Conjunction(A, B, new Disjunction(C, D, E));
            BooleanExpression actual   = conj2.Flatten();

            Assert.Equal(expected, actual);
        }
        public void FlattenWithNegation()
        {
            Conjunction conj1 = new Conjunction(new Negation(A), new Negation(B));
            Conjunction conj2 = new Conjunction(new Negation(conj1), conj1);

            BooleanExpression actual = conj2.Flatten();

            Conjunction expected = new Conjunction(new Negation(new Conjunction(new Negation(A), new Negation(B))),
                                                   new Negation(A),
                                                   new Negation(B));

            Assert.Equal(expected, actual);
        }