-Fixed error when deserializing null value into ConcurrentDictionary

This commit is contained in:
James Newton-King
2018-01-20 17:23:38 +13:00
parent e1dfefe00b
commit 8ece2b31b9
4 changed files with 33 additions and 2 deletions
@@ -61,6 +61,20 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture]
public class JsonSerializerCollectionsTests : TestFixtureBase
{
#if !(NET35 || NET20 || PORTABLE || PORTABLE40) || NETSTANDARD2_0
[Test]
public void DeserializeConcurrentDictionaryWithNullValue()
{
const string key = "id";
var jsonValue = $"{{\"{key}\":null}}";
var deserializedObject = JsonConvert.DeserializeObject<ConcurrentDictionary<string, string>>(jsonValue);
Assert.IsNull(deserializedObject[key]);
}
#endif
#if !(NET20 || NET35)
[Test]
public void SerializeConcurrentQueue()