Beispiel #1
0
        public void CanConvertEmptyArray()
        {
            var a = new WithIntArray {
                MyNumbers = new int[] {}
            };

            var builder   = new IonConverter.IonDocumentConverter();
            var doc       = builder.ConvertFrom <WithIntArray>(a);
            var listField = doc.GetField("MyNumbers");

            Assert.Equal(0, listField.Count);
        }
Beispiel #2
0
        public void CanConvertIntArray()
        {
            var a = new WithIntArray {
                MyNumbers = new int[] {
                    1, 2, 3, 4, 5, 6, 7, 8, 9, 10
                }
            };

            var builder   = new IonConverter.IonDocumentConverter();
            var doc       = builder.ConvertFrom <WithIntArray>(a);
            var listField = doc.GetField("MyNumbers");

            Assert.Equal(10, listField.Count);
            var element = listField.GetElementAt(8);

            Assert.Equal(9, element.BigIntegerValue);
        }