Home | History | Annotate | Download | only in shadows
      1 package org.robolectric.shadows;
      2 
      3 import static org.assertj.core.api.Assertions.assertThat;
      4 
      5 import android.util.JsonReader;
      6 import java.io.StringReader;
      7 import org.junit.Test;
      8 import org.junit.runner.RunWith;
      9 import org.robolectric.RobolectricTestRunner;
     10 
     11 @RunWith(RobolectricTestRunner.class)
     12 public class ShadowJsonReaderTest {
     13   @Test public void shouldWork() throws Exception {
     14     JsonReader jsonReader = new JsonReader(new StringReader("{\"abc\": \"def\"}"));
     15     jsonReader.beginObject();
     16     assertThat(jsonReader.nextName()).isEqualTo("abc");
     17     assertThat(jsonReader.nextString()).isEqualTo("def");
     18     jsonReader.endObject();
     19   }
     20 }
     21