public void Serialization() { Action <object, bool> del = (source, binary) => { var mode = binary ? "binary" : "text/soap"; ConsoleEx.WriteLine("\n- Source ({0}): {1}", mode, source); var path = "c:\\temp\\data"; path += binary ? ".bin" : ".xml"; path.PathSerialize(source, binary); var temp = path.PathDeserialize(binary); ConsoleEx.WriteLine("- Created ({0}): {1}", mode, temp); var result = source.IsEquivalentTo(temp); Assert.IsTrue(result, "With mode '{0}' source '{1}' and deserialized '{2}' are not equivalent." .FormatWith(mode, source.Sketch(), temp.Sketch())); }; var obj = new Concrete.SchemaEntry() { TableName = "MyTable", ColumnName = "MyColumn" }; obj.Metadata["OtherMetadata"] = "whatever"; del(obj, true); del(obj, false); }
public void Cloning() { Action<object> del = (source) => { ConsoleEx.WriteLine("\n- Source: {0}", source); var temp = ((ICloneable)source).Clone(); ConsoleEx.WriteLine("- Cloned: {0}", temp); Assert.IsTrue(source.IsEquivalentTo(temp), "Source '{0}' and cloned '{1}' are not equivalent." .FormatWith(source, temp)); }; var obj = new Concrete.SchemaEntry() { TableName = "MyTable", ColumnName = "MyColumn" }; obj.Metadata["OtherMetadata"] = "whatever"; del(obj); }
public void Cloning() { Action <object> del = (source) => { ConsoleEx.WriteLine("\n- Source: {0}", source); var temp = ((ICloneable)source).Clone(); ConsoleEx.WriteLine("- Cloned: {0}", temp); Assert.IsTrue(source.IsEquivalentTo(temp), "Source '{0}' and cloned '{1}' are not equivalent." .FormatWith(source, temp)); }; var obj = new Concrete.SchemaEntry() { TableName = "MyTable", ColumnName = "MyColumn" }; obj.Metadata["OtherMetadata"] = "whatever"; del(obj); }
public void Serialization() { Action<object, bool> del = (source, binary) => { var mode = binary ? "binary" : "text/soap"; ConsoleEx.WriteLine("\n- Source ({0}): {1}", mode, source); var path = "c:\\temp\\data"; path += binary ? ".bin" : ".xml"; path.PathSerialize(source, binary); var temp = path.PathDeserialize(binary); ConsoleEx.WriteLine("- Created ({0}): {1}", mode, temp); var result = source.IsEquivalentTo(temp); Assert.IsTrue(result, "With mode '{0}' source '{1}' and deserialized '{2}' are not equivalent." .FormatWith(mode, source.Sketch(), temp.Sketch())); }; var obj = new Concrete.SchemaEntry() { TableName = "MyTable", ColumnName = "MyColumn" }; obj.Metadata["OtherMetadata"] = "whatever"; del(obj, true); del(obj, false); }