AjTalk.Tests.Compiler.SimpleCompilerTests.ExecuteNew C# (CSharp) Method

ExecuteNew() private method

private ExecuteNew ( ) : void
return void
        public void ExecuteNew()
        {
            Machine machine = new Machine();

            IClass cls = this.CompileClass(
                "Rectangle",
                new string[] { "x", "y" },
                null);

            cls.DefineClassMethod(new BehaviorDoesNotUnderstandMethod(machine, cls));

            machine.SetGlobalObject("Rectangle", cls);

            Block block = this.compiler.CompileBlock("^Rectangle new");

            Assert.IsNotNull(block);

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

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IObject));
            Assert.AreEqual(cls, ((IObject)obj).Behavior);
        }
SimpleCompilerTests