Improve tests

This commit is contained in:
Bond_009
2021-02-23 16:45:10 +01:00
parent aff0aea60f
commit acac21d8dc
8 changed files with 755 additions and 24 deletions

View File

@@ -69,7 +69,7 @@ namespace MediaBrowser.Common.Json.Converters
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, T[] value, JsonSerializerOptions options)
{
JsonSerializer.Serialize(writer, value, options);
throw new NotImplementedException();
}
}
}

View File

@@ -69,7 +69,7 @@ namespace MediaBrowser.Common.Json.Converters
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, T[] value, JsonSerializerOptions options)
{
JsonSerializer.Serialize(writer, value, options);
throw new NotImplementedException();
}
}
}

View File

@@ -1,20 +0,0 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace MediaBrowser.Common.Json.Converters
{
/// <summary>
/// Converts a Version object or value to/from JSON.
/// </summary>
public class JsonVersionConverter : JsonConverter<Version>
{
/// <inheritdoc />
public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> new Version(reader.GetString());
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, Version value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString());
}
}

View File

@@ -35,7 +35,6 @@ namespace MediaBrowser.Common.Json
{
new JsonGuidConverter(),
new JsonNullableGuidConverter(),
new JsonVersionConverter(),
new JsonStringEnumConverter(),
new JsonNullableStructConverterFactory(),
new JsonBoolNumberConverter(),