public void CanValidateHasNoGenericArguments() { PrettyTypeResolver.Create(new[] { typeof(List <>) }); Assert.That.Throws <DynamicException>(() => PrettyTypeResolver.Create(new[] { typeof(List <int>) })); }
public T Deserialize <T>(Stream jsonStream) { if (jsonStream == null) { throw new ArgumentNullException(nameof(jsonStream)); } using (var streamReader = new StreamReader(jsonStream)) using (var jsonTextReader = new PrettyTypeReader(streamReader, PrettyTypeReader.AbbreviatedTypePropertyName, PrettyTypeResolver.Create(_jsonTypes))) { return(_jsonSerializer.Deserialize <T>(jsonTextReader)); } }