1515 */
1616package com .example .android .sunshine .app .data ;
1717
18+ import android .content .UriMatcher ;
1819import android .net .Uri ;
1920import android .test .AndroidTestCase ;
2021
@@ -41,16 +42,16 @@ public class TestUriMatcher extends AndroidTestCase {
4142 for each of the Uri types that our ContentProvider can handle. Uncomment this when you are
4243 ready to test your UriMatcher.
4344 */
44- // public void testUriMatcher() {
45- // UriMatcher testMatcher = WeatherProvider.buildUriMatcher();
46- //
47- // assertEquals("Error: The WEATHER URI was matched incorrectly.",
48- // testMatcher.match(TEST_WEATHER_DIR), WeatherProvider.WEATHER);
49- // assertEquals("Error: The WEATHER WITH LOCATION URI was matched incorrectly.",
50- // testMatcher.match(TEST_WEATHER_WITH_LOCATION_DIR), WeatherProvider.WEATHER_WITH_LOCATION);
51- // assertEquals("Error: The WEATHER WITH LOCATION AND DATE URI was matched incorrectly.",
52- // testMatcher.match(TEST_WEATHER_WITH_LOCATION_AND_DATE_DIR), WeatherProvider.WEATHER_WITH_LOCATION_AND_DATE);
53- // assertEquals("Error: The LOCATION URI was matched incorrectly.",
54- // testMatcher.match(TEST_LOCATION_DIR), WeatherProvider.LOCATION);
55- // }
45+ public void testUriMatcher () {
46+ UriMatcher testMatcher = WeatherProvider .buildUriMatcher ();
47+
48+ assertEquals ("Error: The WEATHER URI was matched incorrectly." ,
49+ testMatcher .match (TEST_WEATHER_DIR ), WeatherProvider .WEATHER );
50+ assertEquals ("Error: The WEATHER WITH LOCATION URI was matched incorrectly." ,
51+ testMatcher .match (TEST_WEATHER_WITH_LOCATION_DIR ), WeatherProvider .WEATHER_WITH_LOCATION );
52+ assertEquals ("Error: The WEATHER WITH LOCATION AND DATE URI was matched incorrectly." ,
53+ testMatcher .match (TEST_WEATHER_WITH_LOCATION_AND_DATE_DIR ), WeatherProvider .WEATHER_WITH_LOCATION_AND_DATE );
54+ assertEquals ("Error: The LOCATION URI was matched incorrectly." ,
55+ testMatcher .match (TEST_LOCATION_DIR ), WeatherProvider .LOCATION );
56+ }
5657}
0 commit comments