Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2008 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 |
package org.eclipse.draw2d.test; |
12 |
|
13 |
import junit.framework.TestCase; |
14 |
|
15 |
import org.eclipse.draw2d.geometry.Ray; |
16 |
|
17 |
/** |
18 |
* Ray's tests |
19 |
* |
20 |
* @author aboyko |
21 |
* |
22 |
*/ |
23 |
public class RayTest extends TestCase { |
24 |
|
25 |
/** |
26 |
* @see TestCase#setUp() |
27 |
*/ |
28 |
protected void setUp() throws Exception { |
29 |
super.setUp(); |
30 |
} |
31 |
|
32 |
/** |
33 |
* @see TestCase#tearDown() |
34 |
*/ |
35 |
protected void tearDown() throws Exception { |
36 |
super.tearDown(); |
37 |
} |
38 |
|
39 |
public void test_length() { |
40 |
testLengthValues(3, 4, 5); |
41 |
testLengthValues(0, Integer.MAX_VALUE, Integer.MAX_VALUE); |
42 |
} |
43 |
|
44 |
private void testLengthValues(int x, int y, double expectedLength) { |
45 |
Ray ray = new Ray(x, y); |
46 |
assertEquals(expectedLength, ray.length(), 0); |
47 |
} |
48 |
} |