title: How to read entire string from JsonTextReader
body: <p>I have a JsonConverter. I created a unit test for the ReadJson. I have an error in my unit test that says the reader value is null. How can I read the entire string from the reader?</p>
  <pre><code>public class StringConverter&lt;T&gt; : JsonConverter
  {
      public override bool CanConvert(Type objectType)
      {
          return objectType == typeof(T);
      }
  
      public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
      {
          return JsonConvert.DeserializeObject&lt;T&gt;((string)reader.Value);
      }
  
      public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
      {
          JsonConvert.SerializeObject(value);
      }
  }
  </code></pre>
  <p>My code for unit testing</p>
  <pre><code>    private Converter.StringConverter&lt;InstanceSettings&gt; _converter;
  
      private JsonTextReader CreateJsonReader(string json)
          =&gt; new JsonTextReader(new StringReader(json));
  
      [SetUp]
      public override void Setup()
      {
          base.Setup();
          _converter = new Converter.InstanceSettingsConverter();
      }
  
     public void StringConverter_ReadJson_InvalidJson_EmptyInstanceSettings()
      {
          // Arrange
          var serializer = new JsonSerializer();
          var json = &quot;{\&quot;property\&quot;:{\&quot;search\&quot;:true}}&quot;;
          var reader = CreateJsonReader(json);
  
          // Act
          var result = _converter.ReadJson(reader, typeof(InstanceSettings), null, serializer);
  
          Assert.IsNotNull(result);
          Assert.IsAssignableFrom&lt;InstanceSettings&gt;(result);
      }
  </code></pre>
  <p>I user the converter to convert string to my type</p>
  <pre><code>    [JsonConverter(typeof(StringConverter&lt;InstanceSettings&gt;))]
      [JsonProperty(&quot;settings&quot;)]
      public InstanceSettings Settings { get; set; }
      
  </code></pre>