mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
added custom IntConverter to get around the mono bug
http://json.codeplex.com/workitem/24176
This commit is contained in:
parent
904061c2f0
commit
41c5619d1b
15 changed files with 122 additions and 56 deletions
|
@ -1,3 +1,5 @@
|
|||
using System;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Test.Common;
|
||||
|
@ -9,15 +11,19 @@ namespace NzbDrone.Libraries.Test.JsonTests
|
|||
{
|
||||
public class TypeWithNumbers
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Int32 { get; set; }
|
||||
public Int64 Int64 { get; set; }
|
||||
public int? nullableIntIsNull { get; set; }
|
||||
public int? nullableWithValue { get; set; }
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_deserialize_numbers()
|
||||
{
|
||||
var quality = new TypeWithNumbers { Id = 12 };
|
||||
var quality = new TypeWithNumbers { Int32 = Int32.MaxValue, Int64 = Int64.MaxValue, nullableWithValue = 12 };
|
||||
var result = Json.Deserialize<TypeWithNumbers>(quality.ToJson());
|
||||
|
||||
Json.Deserialize<TypeWithNumbers>(quality.ToJson());
|
||||
result.ShouldHave().AllProperties().EqualTo(quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue