|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2006 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
| 10 |
*******************************************************************************/ |
| 11 |
|
| 12 |
package org.eclipse.draw2d.test; |
| 13 |
|
| 14 |
import junit.framework.TestCase; |
| 15 |
|
| 16 |
import org.eclipse.draw2d.geometry.Point; |
| 17 |
import org.eclipse.draw2d.geometry.Rectangle; |
| 18 |
|
| 19 |
|
| 20 |
public class RectangleTest extends TestCase { |
| 21 |
/** |
| 22 |
* @see TestCase#setUp() |
| 23 |
*/ |
| 24 |
protected void setUp() throws Exception { |
| 25 |
super.setUp(); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* @see TestCase#tearDown() |
| 30 |
*/ |
| 31 |
protected void tearDown() throws Exception { |
| 32 |
super.tearDown(); |
| 33 |
} |
| 34 |
|
| 35 |
public void test_creationSymmetry() { |
| 36 |
Point topLeft = new Point(0, 0); |
| 37 |
Point topRight = new Point(10, 0); |
| 38 |
Point bottomLeft = new Point(0, 10); |
| 39 |
Point bottomRight = new Point(10, 10); |
| 40 |
Rectangle rect1 = new Rectangle(topLeft, bottomRight); |
| 41 |
Rectangle rect2 = new Rectangle(topRight, bottomLeft); |
| 42 |
|
| 43 |
assertTrue(rect1.equals(rect2)); |
| 44 |
} |
| 45 |
|
| 46 |
} |