public static void Compare(InterfaceEntity from, InterfaceEntity to) { Assert.AreEqual(from.ImplementationOne, to.ImplementationOne); Assert.AreEqual(from.ImplementationTwo, to.ImplementationTwo); Assert.AreEqual(from.SomeNullValue, to.SomeNullValue); CompareArray(from.ListOfInterface, to.ListOfInterface); CompareArray(from.ArrayOfInterface, to.ArrayOfInterface); }
public void DNETSerialize() { var values = new InterfaceEntity(); values.Populate(); var tested = DNETSerializeHelper.TestDNETSerialize(values); Compare(values, tested.Item3 as InterfaceEntity); Debug.WriteLine($"InterfaceTest.DNETSerialize - Bytes: {tested.Item2.ToString()} - Elapsed: {tested.Item1.ToString()}"); }
public void CustomSerialize() { var values = new InterfaceEntity(); values.Populate(); var sw = Stopwatch.StartNew(); var serialize = BinarySerialize.From<InterfaceEntity>(); var bytes = serialize.Serialize(values); var returnedValues = serialize.Deserialize(bytes); sw.Stop(); Compare(values, returnedValues); Debug.WriteLine($"InterfaceTest.CustomSerialize - Bytes: {bytes.Length.ToString()} - Elapsed: {sw.Elapsed.ToString()}"); }