public void VisitVariableInstruction_Throws_NotSupportedException() { // arrange var computeAssembler = Substitute.For <IInstructionAssembler <ComputeInstruction> >(); var addressAssembler = Substitute.For <IInstructionAssembler <AddressInstruction> >(); IInstructionVisitor <string[]> visitor = new AssemblyInstructionVisitor(computeAssembler, addressAssembler); var instruction = new VariableInstruction("some.value"); // act TestDelegate testDelegate = () => visitor.VisitInstruction(instruction); // assert Assert.Throws <NotSupportedException>(testDelegate); }
private VariableValue(VariableInstruction variable, Context context) : base(context) { _variable = variable; }
public bool VisitInstruction(VariableInstruction instruction) { return(true); }
public string[] VisitInstruction(VariableInstruction instruction) { throw new NotSupportedException("Symbols need to be resolved before they can be assembled"); }
public void VisitVariableInstruction_Throws_NotSupportedException() { // arrange var computeAssembler = Substitute.For<IInstructionAssembler<ComputeInstruction>>(); var addressAssembler = Substitute.For<IInstructionAssembler<AddressInstruction>>(); IInstructionVisitor<string[]> visitor = new AssemblyInstructionVisitor(computeAssembler, addressAssembler); var instruction = new VariableInstruction("some.value"); // act TestDelegate testDelegate = () => visitor.VisitInstruction(instruction); // assert Assert.Throws<NotSupportedException>(testDelegate); }
internal AssignInstruction(VariableInstruction target, Instruction assignedValue) { Target = target; AssignedValue = assignedValue; }