Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * OfficeFloor - http://www.officefloor.net
  * 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
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 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 <http://www.gnu.org/licenses/>.
 */
package net.officefloor.model.impl.desk;
Tests removing a net.officefloor.model.desk.WorkModel.

Author(s):
Daniel Sagenschneider
public class RemoveWorkTest extends AbstractDeskChangesTestCase {

Specific setup file per test.
	public RemoveWorkTest() {
		super(true);
	}

	public void testRemoveWorkNotOnDesk() {
		// Attempt to remove work not on the desk
		WorkModel workNotOnDesk = new WorkModel("NOT ON DESK"null);
		Change<WorkModelchange = this..removeWork(workNotOnDesk);
		this.assertChange(changeworkNotOnDesk"Remove work NOT ON DESK",
				false"Work NOT ON DESK not on desk");
	}

Ensure can remove net.officefloor.model.desk.WorkModel without any connections.
		// Obtain the work and remove it
		WorkModel work = this..getWorks().get(0);
		Change<WorkModelchange = this..removeWork(work);
		this.assertChange(changework"Remove work WORK"true);
	}

	public void testRemoveWorkWithATask() {
		// Obtain the work and remove it
		WorkModel work = this..getWorks().get(0);
		Change<WorkModelchange = this..removeWork(work);
		this.assertChange(changework"Remove work WORK"true);
	}

		// Obtain the work and remove it
		WorkModel work = this..getWorks().get(1);
		Change<WorkModelchange = this..removeWork(work);
		this.assertChange(changework"Remove work WORK_B"true);
	}

		// Obtain the work and remove it
		WorkModel work = this..getWorks().get(0);
		Change<WorkModelchange = this..removeWork(work);
		this.assertChange(changework"Remove work WORK_A"true);
	}
New to GrepCode? Check out our FAQ X