Пример #1
0
        private static void TestSingle(Type t, int rounds)
        {
            for (int i = 0; i < rounds; i++)
            {
                MacroOpBase raw = (MacroOpBase)RandomPropertyGenerator.Create(t);
                MacroOpBase cmd = DeserializeSingle(raw.ToByteArray());
                if (!t.GetTypeInfo().IsInstanceOfType(cmd))
                {
                    throw new Exception("Deserialized operation of wrong type");
                }

                RandomPropertyGenerator.AssertAreTheSame(raw, cmd);
            }
        }