Ejemplo n.º 1
0
        public void Check_TypeSupport_Class_Array()
        {
            var arr = new SampleClass[]
            {
                new SampleClass(1, 1.1f),
                new SampleClass(2, 1.2f),
                new SampleClass(3, 1.3f)
            };

            HelperMethods.TestArray(arr);
        }
Ejemplo n.º 2
0
        public void Check_TypeSupport_Class()
        {
            SampleClass obj = new SampleClass()
            {
                TestInt   = 14,
                TestFloat = 12.34f
            };

            using BinaryWriter writer = new BinaryWriter();
            writer.Write(obj, typeof(SampleClass));

            using BinaryReader reader = new BinaryReader(writer.PackBytes());
            Assert.AreEqual(obj.GetHashCode(), reader.Read(typeof(SampleClass)).GetHashCode());
        }
        public void Check_TypeSupport_Class_Multi_Dimensional_Array()
        {
            var arr = new SampleClass[, ]
            {
                {
                    new SampleClass(4, 1.4f),
                    new SampleClass(1, 1.1f),
                },
                {
                    new SampleClass(2, 1.2f),
                    new SampleClass(3, 1.3f)
                }
            };

            HelperMethods.TestArray(arr);
        }