public void Part1_SetNewRegister() { var day8 = new Day8(); var instruction = new Instruction(); instruction.Register = "a"; instruction.Operation = Operation.Inc; instruction.Offset = -100; var registers = new Dictionary <string, int>(); day8.UpdateRegister(instruction, registers); Assert.Equal(-100, registers["a"]); }
public void Part1_UpdateExistingRegister() { var day8 = new Day8(); var instruction = new Instruction(); instruction.Register = "b"; instruction.Operation = Operation.Dec; instruction.Offset = 12; var registers = new Dictionary <string, int>(); registers.Add("b", 100); day8.UpdateRegister(instruction, registers); Assert.Equal(88, registers["b"]); }