1 changed files with 31 additions and 0 deletions
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
package org.springframework.data.document.mongodb.geo; |
||||
|
||||
import static org.hamcrest.CoreMatchers.*; |
||||
import static org.junit.Assert.*; |
||||
|
||||
import org.junit.Test; |
||||
|
||||
/** |
||||
* Unit tests for {@link Point}. |
||||
* |
||||
* @author Oliver Gierke |
||||
*/ |
||||
public class PointUnitTests { |
||||
|
||||
@Test(expected = IllegalArgumentException.class) |
||||
public void rejectsNullforCopyConstructor() { |
||||
new Point(null); |
||||
} |
||||
|
||||
@Test |
||||
public void equalsIsImplementedCorrectly() { |
||||
assertThat(new Point(1.5, 1.5), is(equalTo(new Point(1.5, 1.5)))); |
||||
assertThat(new Point(1.5, 1.5), is(not(equalTo(new Point(2.0, 2.0))))); |
||||
assertThat(new Point(2.0, 2.0), is(not(equalTo(new Point(1.5, 1.5))))); |
||||
} |
||||
|
||||
@Test |
||||
public void invokingToStringWorksCorrectly() { |
||||
new Point(1.5, 1.5).toString(); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue