added custom IntConverter to get around the mono bug

http://json.codeplex.com/workitem/24176
This commit is contained in:
Keivan Beigi 2013-09-18 17:24:50 -07:00
commit 41c5619d1b
15 changed files with 122 additions and 56 deletions

View file

@ -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);
}
}
}