Exemplo n.º 1
0
        public void ShouldLookupObjectMethods()
        {
            Machine machine = new Machine();

            IBehavior objectBehavior = (IBehavior)machine.Object.Behavior;

            Assert.IsNull(objectBehavior.Lookup("lookup:"));
            Assert.IsNotNull(objectBehavior.Lookup("delegated"));
            Assert.IsNull(objectBehavior.Lookup("methodAt:put:"));
            Assert.IsNull(objectBehavior.Lookup("allocate:"));
            Assert.IsNotNull(objectBehavior.Lookup("vtable"));
        }
Exemplo n.º 2
0
        public object Execute(object receiver, params object[] arguments)
        {
            IBehavior self     = (IBehavior)receiver;
            string    selector = (string)arguments[0];

            return(self.Lookup(selector));
        }