*/
public void testAddRoom() {
MockControl mockCtrl = MockControl.createNiceControl(Room.class);
final Room mockRoom = (Room) mockCtrl.getMock();
MockControl obsCtrl = MockClassControl.createControl(Observable.class);
final Observable obs = (Observable) obsCtrl.getMock();
MockControl invCtrl = MockClassControl.createControl(InventoryHandler.class);
final InventoryHandler inv = (InventoryHandler) invCtrl.getMock();
Registry reg = new Registry(null) {
@Override
public void addMudObject(MudObject object) {
// TODO Auto-generated method stub
assertSame(mockRoom, object);
}
@Override
public InventoryHandler getInventoryHandler() {
// TODO Auto-generated method stub
return inv;
}
};
mockRoom.getContainerLocation();
ObjectLocation loc = new ObjectLocation();
loc.setDefinition("tomb/tomb1.groovy");
loc.setBeanId("id");
mockCtrl.setDefaultReturnValue(loc);
mockRoom.setCurrentContainer(reg);
mockCtrl.setDefaultVoidCallable();
mockCtrl.replay();
inv.addMudObject("id", mockRoom);
invCtrl.setDefaultVoidCallable();
invCtrl.replay();
obs.addObserver(reg);
obsCtrl.setDefaultVoidCallable();
obsCtrl.replay();
reg.addMudObject(loc.getBeanId(), mockRoom);