AWSSDK.UnitTests.LitJsonModificationTests.IntLongConversionTest C# (CSharp) Method

IntLongConversionTest() private method

private IntLongConversionTest ( ) : void
return void
        public void IntLongConversionTest()
        {
            string numberJson =
@"{
    ""Int""   : 13,
    ""UInt""  : 4294967295,
    ""Long""  : 4294967296,
    ""ULong"" : 18446744073709551615
}";
            JsonData data = JsonMapper.ToObject(numberJson);

            Assert.AreEqual<int>(13, (int)data["Int"]);
            Assert.AreEqual<uint>(4294967295, (uint)data["UInt"]);
            Assert.AreEqual<long>(4294967296, (long)data["Long"]);
            Assert.AreEqual<ulong>(18446744073709551615, (ulong)data["ULong"]);

            Assert.AreEqual<long>(13, (long)data["Int"]);
            Assert.AreEqual<ulong>(4294967295, (ulong)data["UInt"]);

            Utils.AssertExceptionExpected(() => { int t = (int)data["Long"]; });
            Utils.AssertExceptionExpected(() => { int t = (int)data["UInt"]; });
            Utils.AssertExceptionExpected(() => { int t = (int)data["ULong"]; });
            Utils.AssertExceptionExpected(() => { uint t = (uint)data["ULong"]; });
        }