2013-09-19 00:24:50 +00:00
|
|
|
using System;
|
|
|
|
using FluentAssertions;
|
2013-05-13 02:52:55 +00:00
|
|
|
using NUnit.Framework;
|
2013-05-12 15:18:17 +00:00
|
|
|
using NzbDrone.Common.Serializer;
|
2013-04-17 00:24:49 +00:00
|
|
|
using NzbDrone.Test.Common;
|
2013-04-16 23:21:03 +00:00
|
|
|
|
2013-05-13 02:52:55 +00:00
|
|
|
namespace NzbDrone.Libraries.Test.JsonTests
|
2013-04-16 23:21:03 +00:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2013-05-13 02:52:55 +00:00
|
|
|
public class JsonFixture : TestBase
|
2013-04-16 23:21:03 +00:00
|
|
|
{
|
|
|
|
public class TypeWithNumbers
|
|
|
|
{
|
2013-09-19 00:24:50 +00:00
|
|
|
public int Int32 { get; set; }
|
|
|
|
public Int64 Int64 { get; set; }
|
|
|
|
public int? nullableIntIsNull { get; set; }
|
|
|
|
public int? nullableWithValue { get; set; }
|
2013-04-16 23:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void should_be_able_to_deserialize_numbers()
|
|
|
|
{
|
2013-09-19 00:24:50 +00:00
|
|
|
var quality = new TypeWithNumbers { Int32 = Int32.MaxValue, Int64 = Int64.MaxValue, nullableWithValue = 12 };
|
|
|
|
var result = Json.Deserialize<TypeWithNumbers>(quality.ToJson());
|
2013-04-16 23:21:03 +00:00
|
|
|
|
2013-09-19 00:24:50 +00:00
|
|
|
result.ShouldHave().AllProperties().EqualTo(quality);
|
2013-04-16 23:21:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|