Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * OfficeFloor -
  * Copyright (C) 2005-2011 Daniel Sagenschneider
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <>.
package net.officefloor.model.impl.desk;
Tests renaming the net.officefloor.model.desk.WorkModel.

Daniel Sagenschneider
public class RenameWorkTest extends AbstractDeskChangesTestCase {

	public void testRenameWorkNotOnDesk() {
		WorkModel work = new WorkModel("NOT_ON_DESK"null);
		Change<WorkModelchange = this..renameWork(work"NEW_NAME");
		this.assertChange(changework"Rename work NOT_ON_DESK to NEW_NAME",
				false"Work NOT_ON_DESK not on desk");

Ensure can rename the net.officefloor.model.desk.WorkModel.
	public void testRenameWork() {
		WorkModel work = this..getWorks().get(0);
		Change<WorkModelchange = this..renameWork(work"NEW_NAME");
		this.assertChange(changework"Rename work OLD_NAME to NEW_NAME",

Ensures on renaming the net.officefloor.model.desk.WorkModel that order is maintained.
		WorkModel work = this..getWorks().get(0);
		Change<WorkModelchange = this..renameWork(work"WORK_C");
		this.assertChange(changework"Rename work WORK_A to WORK_C"true);
New to GrepCode? Check out our FAQ X