コード例 #1
0
        public void Check_TypeSupport_Struct_Array()
        {
            var arr = new SampleStruct[]
            {
                new SampleStruct(1, "test1"),
                new SampleStruct(2, "test2"),
                new SampleStruct(3, "test3")
            };

            HelperMethods.TestArray(arr);
        }
コード例 #2
0
        public void Check_TypeSupport_Struct()
        {
            SampleStruct obj = new SampleStruct()
            {
                someInt    = 13,
                someString = "test"
            };

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

            using BinaryReader reader = new BinaryReader(writer.PackBytes());
            Assert.AreEqual(obj.GetHashCode(), reader.Read(typeof(SampleStruct)).GetHashCode());
        }
コード例 #3
0
        public void Check_TypeSupport_Struct_Multi_Dimensional_Array()
        {
            var arr = new SampleStruct[, ]
            {
                {
                    new SampleStruct(1, "test1"),
                    new SampleStruct(2, "test2")
                },
                {
                    new SampleStruct(3, "test3"),
                    new SampleStruct(4, "test4")
                }
            };

            HelperMethods.TestArray(arr);
        }