Example #1
0
        public void OrTestPositive()
        {
            OR n = new OR();

            n.input2 = 0;
            n.input1 = 0;
            n.Calculate();

            Assert.AreEqual(0, n.Calculate());
        }
Example #2
0
        public void OrTestNagative3()
        {
            OR n = new OR();

            n.input2 = 1;
            n.input1 = 1;
            n.Calculate();

            Assert.AreEqual(1, n.Calculate());
        }
Example #3
0
        public void OR_TwoNegative_NegativeOutput()
        {
            // Arrange
            var port = new OR();

            port.Previous.Add(new Input {
                Value = Bit.LOW
            });
            port.Previous.Add(new Input {
                Value = Bit.LOW
            });

            // Act
            port.Calculate();

            // Assert
            Assert.AreEqual(Bit.LOW, port.Value);
        }