// Verify msg type: RandString private static void Verify_RandString() { RandString stSrc = new RandString(); // Make object rand stSrc.data = "test"; byte[] src_bytes = stSrc.ToBytes(); MBinaryReader mbr = new MBinaryReader(src_bytes); RandString stDst = new RandString(); stDst.FromBytes(mbr); // Verify object content // Compare object by bytes byte[] dst_bytes = stDst.ToBytes(); if (dst_bytes.Length != src_bytes.Length) { Console.WriteLine("Failed to verify field: RandString by bytes length"); } for (int byte_index = 0; byte_index < dst_bytes.Length; ++byte_index) { if (src_bytes[byte_index] != dst_bytes[byte_index]) { Console.WriteLine("Failed to verify field: RandString by bytes length"); } } }
// Constructor public EchoMsg() { protocol_version = ""; int_param = 0; int_array = new AUINT32[int_array_size]; char_array = ""; rand_string_field = new RandString(); rand_string_array = new RandString[rand_string_array_size]; for (int element_index = 0; element_index < rand_string_array.Length; ++element_index) { rand_string_array[element_index] = new RandString(); } enum_value = (EResponseCode)0; }