Exemple #1
0
        public void WriteFloat1DArrayTest()
        {
            List <float> values = new List <float>()
            {
                1.5F, -2.0F, 1e21F
            };

            BinaryWriterTest.ArrayHelper <float>(values, 1);
        }
Exemple #2
0
        public void WriteUInt321DArrayTest()
        {
            List <uint> values = new List <uint>()
            {
                1252, 0x02, 0x32, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
            };

            BinaryWriterTest.ArrayHelper <uint>(values, 1);
        }
Exemple #3
0
        public void WriteDouble1DArrayTest()
        {
            List <double> values = new List <double>()
            {
                1.5F, -2.0F, 1e211
            };

            BinaryWriterTest.ArrayHelper <double>(values, 1);
        }
Exemple #4
0
        public void WriteInt641DArrayTest()
        {
            List <long> values = new List <long>()
            {
                1243331, 0x02, 0x64, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, -40000
            };

            BinaryWriterTest.ArrayHelper <long>(values, 1);
        }
Exemple #5
0
        public void WriteString1DArrayTest()
        {
            List <string> values = new List <string>()
            {
                "foo", "bar"
            };

            BinaryWriterTest.ArrayHelper <string>(values, 1);
        }
Exemple #6
0
        public void WriteInt321DArrayTest()
        {
            List <int> values = new List <int>()
            {
                12431, 0x02, 0x32, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, -20000
            };

            BinaryWriterTest.ArrayHelper <int>(values, 1);
        }
Exemple #7
0
        public void WriteInt161DArrayTest()
        {
            List <short> values = new List <short>()
            {
                125, 0x02, 0x32, 0x00, -23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
            };

            BinaryWriterTest.ArrayHelper <short>(values, 1);
        }
Exemple #8
0
        public void WriteEnum1DArrayTest()
        {
            List <TestHelper.TestingEnumType> values = new List <TestHelper.TestingEnumType>()
            {
                TestHelper.TestingEnumType.ReallyLow, TestHelper.TestingEnumType.EvenGreater
            };

            BinaryWriterTest.ArrayHelper <TestHelper.TestingEnumType>(values, 1);
        }
Exemple #9
0
        public void WriteByte1DArrayTest()
        {
            List <byte> values = new List <byte>()
            {
                0x01, 0x02, 0x32, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
            };

            BinaryWriterTest.ArrayHelper <byte>(values, 1);
        }
Exemple #10
0
        public void WriteBoolean1DArrayTest()
        {
            List <bool> values = new List <bool>()
            {
                true, false, true
            };

            BinaryWriterTest.ArrayHelper <bool>(values, 1);
        }
Exemple #11
0
        public void WriteULong641DArrayTest()
        {
            List <ulong> values = new List <ulong>()
            {
                121152, 0x02, 0x64, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
            };

            BinaryWriterTest.ArrayHelper <ulong>(values, 1);
        }
Exemple #12
0
        public void WriteUnexpectedValueFor1DArrayTest()
        {
            List <string> values = new List <string> {
                "foo", "bar"
            };

            TestHelper.ExpectException <TeslaSerializationException>(
                () =>
            {
                BinaryWriterTest.ArrayHelper <string>(values, 2);
            },
                "A non-sequence value is serialized as array. Sequence type must implement ICollection and ICollection<T>. The actual type is System.String T: System.String, rank: 1");
        }
Exemple #13
0
        public void WriteByte2DArrayTest()
        {
            List <List <byte> > values = new List <List <byte> >
            {
                new List <byte>()
                {
                    0x01, 0x02, 0x32, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
                },
                new List <byte>()
                {
                    0x55, 0x66
                },
            };

            BinaryWriterTest.ArrayHelper <byte>(values, 2);
        }
Exemple #14
0
        public void WriteEnum2DArrayTest()
        {
            List <List <TestHelper.TestingEnumType> > values = new List <List <TestHelper.TestingEnumType> >()
            {
                new List <TestHelper.TestingEnumType>()
                {
                    TestHelper.TestingEnumType.ReallyLow, TestHelper.TestingEnumType.EvenGreater
                },
                new List <TestHelper.TestingEnumType>()
                {
                    TestHelper.TestingEnumType.GreaterThan, TestHelper.TestingEnumType.EvenGreater, TestHelper.TestingEnumType.ReallyGreater, TestHelper.TestingEnumType.EvenGreater
                },
            };

            BinaryWriterTest.ArrayHelper <TestHelper.TestingEnumType>(values, 2);
        }
Exemple #15
0
        public void WriteString2DArrayTest()
        {
            List <List <string> > values = new List <List <string> >()
            {
                new List <string>()
                {
                    "foo", "bar"
                },
                new List <string>()
                {
                    "no", "no", "and no"
                },
            };

            BinaryWriterTest.ArrayHelper <string>(values, 2);
        }
Exemple #16
0
        public void WriteDouble2DArrayTest()
        {
            List <List <double> > values = new List <List <double> >
            {
                new List <double>()
                {
                    1.5F, -2.0F, 1e21
                },
                new List <double>()
                {
                    -10e100
                },
            };

            BinaryWriterTest.ArrayHelper <double>(values, 2);
        }
Exemple #17
0
        public void WriteInt162DArrayTest()
        {
            List <List <short> > values = new List <List <short> >
            {
                new List <short>()
                {
                    0x01, 0x02, 0x32, 0x00, 0x23, 0x90, -1324, 0xFF, 0xA3, 0xB8, 0x99
                },
                new List <short>()
                {
                    10000, 0x66
                },
            };

            BinaryWriterTest.ArrayHelper <short>(values, 2);
        }
Exemple #18
0
        public void WriteFloat2DArrayTest()
        {
            List <List <float> > values = new List <List <float> >
            {
                new List <float>()
                {
                    1.5F, -2.0F, 1e21F
                },
                new List <float>()
                {
                    -10e10F
                },
            };

            BinaryWriterTest.ArrayHelper <float>(values, 2);
        }
Exemple #19
0
        public void WriteInt322DArrayTest()
        {
            List <List <int> > values = new List <List <int> >
            {
                new List <int>()
                {
                    0x01, 0x02, 0x32, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, -20000
                },
                new List <int>()
                {
                    5555, 0x66
                },
            };

            BinaryWriterTest.ArrayHelper <int>(values, 2);
        }
Exemple #20
0
        public void WriteInt642DArrayTest()
        {
            List <List <long> > values = new List <List <long> >
            {
                new List <long>()
                {
                    0x01, 0x02, 0x64, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, -200000
                },
                new List <long>()
                {
                    555335, 0x66
                },
            };

            BinaryWriterTest.ArrayHelper <long>(values, 2);
        }
Exemple #21
0
        public void WriteBoolean2DArrayTest()
        {
            List <List <bool> > values = new List <List <bool> >
            {
                new List <bool>()
                {
                    true, false, true
                },
                new List <bool>()
                {
                    false
                },
            };

            BinaryWriterTest.ArrayHelper <bool>(values, 2);
        }
Exemple #22
0
        public void WriteUInt322DArrayTest()
        {
            List <List <uint> > values = new List <List <uint> >
            {
                new List <uint>()
                {
                    0x01, 0x02, 0x32, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
                },
                new List <uint>()
                {
                    100020, 0x66
                },
            };

            BinaryWriterTest.ArrayHelper <uint>(values, 2);
        }
Exemple #23
0
        public void WriteULong642DArrayTest()
        {
            List <List <ulong> > values = new List <List <ulong> >
            {
                new List <ulong>()
                {
                    0x01, 0x02, 0x64, 0x00, 0x23, 0x90, 0xFE, 0xFF, 0xA3, 0xB8, 0x99
                },
                new List <ulong>()
                {
                    10001120, 0x66
                },
            };

            BinaryWriterTest.ArrayHelper <ulong>(values, 2);
        }
Exemple #24
0
 public void WriteNullableArrayTest()
 {
     BinaryWriterTest.ArrayHelper <short>(null, true, 1);
 }
Exemple #25
0
 /// <summary>
 /// Helps test n-dimensional arrays.
 /// </summary>
 /// <typeparam name="T">Type of the underlying value stored in the array.</typeparam>
 /// <param name="values">The values.</param>
 /// <param name="rank">The rank.</param>
 private static void ArrayHelper <T>(ICollection values, uint rank)
 {
     BinaryWriterTest.ArrayHelper <T>(values, false, rank);
 }