15
15
*/
16
16
package com .example .android .sunshine .app .data ;
17
17
18
+ import android .net .Uri ;
18
19
import android .test .AndroidTestCase ;
19
20
20
21
/*
@@ -30,15 +31,15 @@ public class TestWeatherContract extends AndroidTestCase {
30
31
/*
31
32
Students: Uncomment this out to test your weather location function.
32
33
*/
33
- // public void testBuildWeatherLocation() {
34
- // Uri locationUri = WeatherContract.WeatherEntry.buildWeatherLocation(TEST_WEATHER_LOCATION);
35
- // assertNotNull("Error: Null Uri returned. You must fill-in buildWeatherLocation in " +
36
- // "WeatherContract.",
37
- // locationUri);
38
- // assertEquals("Error: Weather location not properly appended to the end of the Uri",
39
- // TEST_WEATHER_LOCATION, locationUri.getLastPathSegment());
40
- // assertEquals("Error: Weather location Uri doesn't match our expected result",
41
- // locationUri.toString(),
42
- // "content://com.example.android.sunshine.app/weather/%2FNorth%20Pole");
43
- // }
34
+ public void testBuildWeatherLocation () {
35
+ Uri locationUri = WeatherContract .WeatherEntry .buildWeatherLocation (TEST_WEATHER_LOCATION );
36
+ assertNotNull ("Error: Null Uri returned. You must fill-in buildWeatherLocation in " +
37
+ "WeatherContract." ,
38
+ locationUri );
39
+ assertEquals ("Error: Weather location not properly appended to the end of the Uri" ,
40
+ TEST_WEATHER_LOCATION , locationUri .getLastPathSegment ());
41
+ assertEquals ("Error: Weather location Uri doesn't match our expected result" ,
42
+ locationUri .toString (),
43
+ "content://com.example.android.sunshine.app/weather/%2FNorth%20Pole" );
44
+ }
44
45
}
0 commit comments