assertEquals("Group should be set from project name", "projectForTeddy", teddy.getGroup());
}
public void testNewUserFound_AddThisUserToModel() throws Exception {
final BaseUserImpl teddy = setTeddyUserIsFound();
myUserModelMock.expects(once()).method("hasUser").with(eq(teddy)).will(returnValue(false));
myUserModelMock.expects(once()).method("getGroups").will(returnValue(null));
final List<User> userList = new ArrayList<User>();
userList.add(teddy);
myIDEFacade.setReturnedData(new FindUsersCommand.UsersInfo(new User[]{teddy}, "new group"));
myUserModelMock.expects(once()).method("addUser").with(eq(teddy));
myUserModelMock.expects(once()).method("findUser").with(eq(teddy.getName()), eq(teddy.getTransportCode()))
.will(returnValue(teddy));
myCommand.execute();
assertEquals("User group should be updated", "new group", teddy.getGroup());
}