public void GetAssociatedClassSameName() { Machine hostmachine = new Machine(); IClass hostklass = hostmachine.CreateClass("Rectangle"); hostmachine.SetGlobalObject(hostklass.Name, hostklass); Machine machine = new Machine(); IClass klass = machine.CreateClass("Rectangle"); machine.SetGlobalObject(klass.Name, klass); var result = hostmachine.GetAssociatedClass(klass); Assert.IsNotNull(result); Assert.AreSame(hostklass, result); }
public void NotAssociatedSuperClass() { Machine hostmachine = new Machine(); Machine machine = new Machine(); IClass superclass = machine.CreateClass("Figure"); machine.SetGlobalObject(superclass.Name, superclass); IClass klass = machine.CreateClass("Rectangle", superclass); machine.SetGlobalObject(klass.Name, klass); var result = hostmachine.GetAssociatedClass(klass); Assert.IsNotNull(result); Assert.AreSame(hostmachine.UndefinedObjectClass, result); }