@@ -33,7 +33,8 @@ public class NearbyAdapterFactoryTest {
3333 private static final Place PLACE = new Place ("name" , Place .Label .AIRPORT ,
3434 "desc" , null , new LatLng (38.6270 , -90.1994 , 0 ), null );
3535 private static final Place UNKNOWN_PLACE = new Place ("name" , Place .Label .UNKNOWN ,
36- "desc" , null , new LatLng (39.7392 , -104.9903 , 0 ), null );
36+ "?" , null , new LatLng (39.7392 , -104.9903 , 0 ), null );
37+ // ^ "?" is a special value for unknown class names from Wikidata query results
3738 private Place clickedPlace ;
3839
3940 @ Test
@@ -68,12 +69,13 @@ public void rendererCorrectlyBound() {
6869
6970 RendererViewHolder viewHolder = renderComponent (result );
7071
72+ // test that the values we gave are actually rendered
7173 assertNotNull (viewHolder .itemView .findViewById (R .id .tvName ));
72- assertEquals (" name" ,
74+ assertEquals (PLACE . name ,
7375 ((TextView ) viewHolder .itemView .findViewById (R .id .tvName )).getText ().toString ());
7476
7577 assertNotNull (viewHolder .itemView .findViewById (R .id .tvDesc ));
76- assertEquals ("airport" ,
78+ assertEquals (PLACE . getLongDescription () ,
7779 ((TextView ) viewHolder .itemView .findViewById (R .id .tvDesc )).getText ().toString ());
7880
7981 assertNotNull (viewHolder .itemView .findViewById (R .id .distance ));
@@ -94,7 +96,7 @@ public void rendererCorrectlyBoundForUnknownPlace() {
9496 RendererViewHolder viewHolder = renderComponent (result );
9597
9698 assertNotNull (viewHolder .itemView .findViewById (R .id .tvDesc ));
97- assertEquals ("no description found" ,
99+ assertEquals (RuntimeEnvironment . application . getString ( R . string . no_description_found ) ,
98100 ((TextView ) viewHolder .itemView .findViewById (R .id .tvDesc )).getText ().toString ());
99101
100102 assertNotNull (viewHolder .itemView .findViewById (R .id .icon ));
0 commit comments