Skip to content

Commit 149bb1c

Browse files
committed
Add unit tests for ParseGeoPoint constructors
1 parent 168cb1f commit 149bb1c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2015-present, Parse, LLC.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
package com.parse;
10+
11+
import org.junit.Test;
12+
13+
import static org.junit.Assert.*;
14+
15+
public class ParseGeoPointTest {
16+
17+
@Test
18+
public void testConstructors() {
19+
ParseGeoPoint point = new ParseGeoPoint();
20+
assertEquals(0, point.getLatitude(), 0);
21+
assertEquals(0, point.getLongitude(), 0);
22+
23+
double lat = 1.0;
24+
double lng = 2.0;
25+
point = new ParseGeoPoint(lat, lng);
26+
assertEquals(lat, point.getLatitude(), 0);
27+
assertEquals(lng, point.getLongitude(), 0);
28+
29+
ParseGeoPoint copy = new ParseGeoPoint(point);
30+
assertEquals(lat, copy.getLatitude(), 0);
31+
assertEquals(lng, copy.getLongitude(), 0);
32+
}
33+
}

0 commit comments

Comments
 (0)