package com.firebase.geofire;

import junit.framework.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class GeoLocationTest {
    @Rule
    public org.junit.rules.ExpectedException exception = ExpectedException.none();

    @Test
    public void geoLocationHasCorrectValues() {
        Assert.assertEquals(new GeoLocation(1,2).latitude, 1.0);
        Assert.assertEquals(new GeoLocation(1,2).longitude, 2.0);
        Assert.assertEquals(new GeoLocation(0.000001,2).latitude, 0.000001);
        Assert.assertEquals(new GeoLocation(0,0.000001).longitude, 0.000001);
    }

    @Test
    public void invalidCoordinatesThrowException() {
        try {
            new GeoLocation(-90.1, 90);
            Assert.fail("Did not throw illegal argument exception!");
        } catch (IllegalArgumentException expected) {
        }
        try {
            new GeoLocation(0, -180.1);
            Assert.fail("Did not throw illegal argument exception!");
        } catch (IllegalArgumentException expected) {
        }
        try {
            new GeoLocation(0, 180.1);
            Assert.fail("Did not throw illegal argument exception!");
        } catch (IllegalArgumentException expected) {
        }
        try {
            new GeoLocation(Double.NaN, 0);
            Assert.fail("Did not throw illegal argument exception!");
        } catch (IllegalArgumentException expected) {
        }
        try {
            new GeoLocation(0, Double.NaN);
            Assert.fail("Did not throw illegal argument exception!");
        } catch (IllegalArgumentException expected) {
        }
    }
}

@@ -76,77 +76,12 @@
 nit.
-Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException
+Test
 ;%0Aim
@@ -203,102 +203,8 @@
 t %7B%0A
-    @Rule%0A    public org.junit.rules.ExpectedException exception = ExpectedException.none();%0A%0A
     
@@ -793,32 +793,33 @@
 ed) %7B%0A        %7D%0A
+%0A
         try %7B%0A  
@@ -982,32 +982,33 @@
 ed) %7B%0A        %7D%0A
+%0A
         try %7B%0A  
@@ -1170,32 +1170,33 @@
 ed) %7B%0A        %7D%0A
+%0A
         try %7B%0A  
@@ -1353,32 +1353,32 @@
 ion expected) %7B%0A
-
         %7D%0A      
@@ -1367,24 +1367,25 @@
 %7B%0A        %7D%0A
+%0A
         try 

Clean up GeoLocationTest. (#119)