1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00
Files
Radarr/src/NzbDrone.Libraries.Test/JsonTests/JsonFixture.cs
T
2019-09-03 23:21:15 -04:00

29 lines
871 B
C#

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Serializer;
using NzbDrone.Test.Common;
namespace NzbDrone.Libraries.Test.JsonTests
{
[TestFixture]
public class JsonFixture : TestBase
{
public class TypeWithNumbers
{
public int Int32 { get; set; }
public long 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 { Int32 = int.MaxValue, Int64 = long.MaxValue, nullableWithValue = 12 };
var result = Json.Deserialize<TypeWithNumbers>(quality.ToJson());
result.Should().BeEquivalentTo(quality, o => o.IncludingAllRuntimeProperties());
}
}
}