Esempio n. 1
0
        public void MediumCompositeCircut()
        {
            var notGate1 = NotGateBuilder
                           .WithInput(Generator.AnInactiveSignal())
                           .Build();

            var notGate2 = NotGateBuilder
                           .WithInput(Generator.AnActiveSignal())
                           .Build();

            var andGate = AndGateBuilder
                          .WithInput(notGate1)
                          .WithInput(notGate2)
                          .Build();

            var notGate3 = NotGateBuilder
                           .WithInput(andGate)
                           .Build();

            var orGate = OrGateBuilder
                         .WithInput(Generator.AnInactiveSignal())
                         .WithInput(notGate3)
                         .Build();

            Assert.True(orGate.Output());
        }
Esempio n. 2
0
        public void Zero_Xor_Zero_Is_Zero()
        {
            var xorGate = XorGateBuilder
                          .WithInput(Generator.AnInactiveSignal())
                          .WithInput(Generator.AnInactiveSignal())
                          .Build();

            Assert.False(xorGate.Output());
        }
Esempio n. 3
0
        public void Zero_And_One_Is_Zero()
        {
            var andGate = AndGateBuilder
                          .WithInput(Generator.AnActiveSignal())
                          .WithInput(Generator.AnInactiveSignal())
                          .Build();

            Assert.False(andGate.Output());
        }
Esempio n. 4
0
        public void Zero_Or_One_Is_One()
        {
            var orGate = OrGateBuilder
                         .WithInput(Generator.AnInactiveSignal())
                         .WithInput(Generator.AnActiveSignal())
                         .Build();

            Assert.True(orGate.Output());
        }
Esempio n. 5
0
        public void Zero_Negated_Is_One()
        {
            var notGate = NotGateBuilder
                          .WithInput(
                Generator.AnInactiveSignal()
                )
                          .Build();

            Assert.True(notGate.Output());
        }
Esempio n. 6
0
        //  can be removed; just trying out stuff
        public void BasicComposite_NoBuilders()
        {
            var notGate = new NotGate();

            notGate.SetInput(Generator.AnInactiveSignal());

            var orGate = new OrGate();

            orGate.AddInput(Generator.AnInactiveSignal());
            orGate.AddInput(Generator.AnActiveSignal());

            var andGate = new AndGate();

            andGate.AddInput(notGate);
            andGate.AddInput(orGate);

            Assert.True(andGate.Output());
        }
Esempio n. 7
0
        public void BasicCompositeCircuit()
        {
            var notGate = NotGateBuilder
                          .WithInput(Generator.AnInactiveSignal())
                          .Build();

            var orGate = OrGateBuilder
                         .WithInput(Generator.AnInactiveSignal())
                         .WithInput(Generator.AnActiveSignal())
                         .Build();

            var andGate = AndGateBuilder
                          .WithInput(notGate)
                          .WithInput(orGate)
                          .Build();

            Assert.True(andGate.Output());
        }