public void CanParseInstruction() { var ins = Day8.ParseInstruction("acc +6"); Assert.AreEqual("acc", ins.Operator); Assert.AreEqual(6, ins.Argument); }
public void ParseInstruction() { var instruction = Day8.ParseInstruction("b inc 5 if a > 1"); Assert.That(instruction.Register, Is.EqualTo("b")); Assert.That(instruction.Function, Is.EqualTo("inc")); Assert.That(instruction.Parameter, Is.EqualTo(5)); Assert.That(instruction.Reference, Is.EqualTo("a")); Assert.That(instruction.Operator, Is.EqualTo(">")); Assert.That(instruction.Value, Is.EqualTo(1)); }