Exemple #1
0
        public void TestAddNegative()
        {
            int                 inputA   = -2;
            int                 inputB   = -3;
            const int           EXPECTED = -5;
            ArithmeticLogicUnit alu      = new ArithmeticLogicUnit()
            {
                InputA = inputA,
                InputB = inputB
            };

            alu.Add();
            Assert.AreEqual(EXPECTED, alu.Output);
        }
Exemple #2
0
        public void TestAddPositive()
        {
            // Arrange
            int                 inputA   = 5;
            int                 inputB   = 10;
            const int           EXPECTED = 15;
            ArithmeticLogicUnit alu      = new ArithmeticLogicUnit()
            {
                InputA = inputA,
                InputB = inputB
            };

            // Act
            alu.Add();
            // Assert
            Assert.AreEqual(EXPECTED, alu.Output);
        }