Пример #1
0
        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);
        }
Пример #2
0
 private VariableValue(VariableInstruction variable, Context context)
     : base(context)
 {
     _variable = variable;
 }
Пример #3
0
 public bool VisitInstruction(VariableInstruction instruction)
 {
     return(true);
 }
Пример #4
0
 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);
        }
Пример #6
0
 internal AssignInstruction(VariableInstruction target, Instruction assignedValue)
 {
     Target        = target;
     AssignedValue = assignedValue;
 }