Пример #1
0
        public void TestXor()
        {
            Source srctrue  = new Source(true);
            Source srcfalse = new Source(false);
            XOR    xor      = new XOR();

            xor.addInput(srcfalse);
            xor.addInput(srcfalse);
            XOR xor2 = new XOR();

            xor2.addInput(srcfalse);
            xor2.addInput(srctrue);
            XOR xor3 = new XOR();

            xor3.addInput(srctrue);
            xor3.addInput(srcfalse);
            XOR xor4 = new XOR();

            xor4.addInput(srctrue);
            xor4.addInput(srctrue);

            srctrue.Execute();
            srcfalse.Execute();

            Assert.AreEqual(xor.state, false);
            Assert.AreEqual(xor2.state, true);
            Assert.AreEqual(xor3.state, true);
            Assert.AreEqual(xor4.state, false);
        }