AjTalk.Tests.Compiler.VmCompilerTests.RunMethods C# (CSharp) Метод

RunMethods() приватный Метод

private RunMethods ( ) : void
Результат void
        public void RunMethods()
        {
            IClass cls = this.CompileClass(
                "Rectangle",
                new string[] { "x", "y" },
                new string[] { "x ^x", "x: newX x := newX", "y ^y", "y: newY y := newY" });

            Assert.IsNotNull(cls);

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

            cls.GetInstanceMethod("x:").Execute(null, obj, new object[] { 10 });

            Assert.AreEqual(10, obj[0]);

            cls.GetInstanceMethod("y:").Execute(null, obj, new object[] { 20 });

            Assert.AreEqual(20, obj[1]);

            Assert.AreEqual(10, cls.GetInstanceMethod("x").Execute(null, obj, new object[] { }));
            Assert.AreEqual(20, cls.GetInstanceMethod("y").Execute(null, obj, new object[] { }));
        }