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")); }
public object Execute(object receiver, params object[] arguments) { IBehavior self = (IBehavior)receiver; string selector = (string)arguments[0]; return(self.Lookup(selector)); }