Exemplo n.º 1
0
        public void Part1_TestFalsePredicate()
        {
            var day8 = new Day8();

            var instruction = new Instruction();

            instruction.ConditionRegister = "a";
            instruction.ConditionType     = Condition.EQ;
            instruction.ConditionValue    = 10;

            var registers = new Dictionary <string, int>();

            var actual = day8.EvaluateCondition(instruction, registers);

            Assert.False(actual);
        }
Exemplo n.º 2
0
        public void Part1_TestTruePredicate()
        {
            var day8 = new Day8();

            var instruction = new Instruction();

            instruction.ConditionRegister = "b";
            instruction.ConditionType     = Condition.GTE;
            instruction.ConditionValue    = 100;

            var registers = new Dictionary <string, int>();

            registers.Add("b", 101);

            var actual = day8.EvaluateCondition(instruction, registers);

            Assert.True(actual);
        }