Пример #1
0
        public void TestIntCodec()
        {
            TestIntNode(0);
            TestIntNode(1);
            TestIntNode(0x100);
            TestIntNode(181);
            TestIntNode(0x10000);
            TestIntNode(1573280);
            TestIntNode(0x1000000);
            TestIntNode(int.MaxValue);
            TestIntNode(-1, EsfType.INT32_BYTE);
            TestIntNode(-0xff);
            TestIntNode(-0xffff);
            TestIntNode(-0xffffff);
            TestIntNode(-11831522);
            TestIntNode(int.MinValue);

            IntNode testNode = new IntNode {
                Value = 17
            };

            VerifyEncodeDecode(testNode);

            IntNode node = new IntNode();

            node.FromString("17");
            assertEqual(node, testNode);
        }