AjTalk.Tests.Compiler.VmCompilerTests.ExecuteBasicInstVarAt C# (CSharp) Method

ExecuteBasicInstVarAt() private method

private ExecuteBasicInstVarAt ( ) : void
return void
        public void ExecuteBasicInstVarAt()
        {
            Machine machine = new Machine();
            IClass cls = this.CompileClass(
                "Rectangle",
                new string[] { "x", "y" },
                new string[] { "x ^x", "x: newX x := newX", "y ^y", "y: newY y := newY" });

            IObject iobj = (IObject)cls.NewObject();

            machine.SetGlobalObject("aRectangle", iobj);

            iobj[0] = 100;

            Block block = this.compiler.CompileBlock("^aRectangle basicInstVarAt: 1");

            Assert.IsNotNull(block);

            object result = block.Execute(machine, null);

            Assert.AreEqual(100, result);
        }