AjTalk.Tests.LoaderTests.ExecuteDefineSubclassWithVariablesFile C# (CSharp) Method

ExecuteDefineSubclassWithVariablesFile() private method

private ExecuteDefineSubclassWithVariablesFile ( ) : void
return void
        public void ExecuteDefineSubclassWithVariablesFile()
        {
            Loader loader = new Loader(@"DefineSubclassWithVariables.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Rectangle"));

            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.AreEqual(0, cls.GetInstanceVariableOffset("x"));
            Assert.AreEqual(1, cls.GetInstanceVariableOffset("y"));
        }