static void Main(string[] args) { SchemaInfo schema = new SchemaInfo("Id", CachedTypes.Int32); schema.DatabaseGeneratedOption = StoreGeneratedPattern.Identity; ; schema.DefaultValue = "1"; schema.IsKey = true; schema.IsNullable = false; schema.MaxLength = 12; schema.Order = 1; schema.ReadOnly = true; schema.SqlValueType = SqlValueType.Parameterized; string xml = schema.XmlSerialize(); SchemaInfo copy = SchemaInfo.FromXml(xml); // ExtTestAsync().Wait(); ExtTest(); ExtTestAsync().Wait(); SelectTest(); SelectSingleTest(); Update_NonIdentity(); Insert_NonIdentity(); UpsertUpdate_NonIdentity(); UpsertInsert_NonIdentity(); Update_Identity(); Insert_Identity(); UpsertUpdate_Identity(); UpsertInsert_Identity(); Delete(); Batch_Update_NonIdentity(); Batch_Insert_NonIdentity(); Batch_Upsert_Update_NonIdentity(); Batch_Upsert_Insert_NonIdentity(); Batch_Update_Identity(); Batch_Insert_Identity(); Batch_Upsert_Update_Identity(); Batch_Upsert_Insert_Identity(); }
public void XmlTest() { SchemaInfo schema = new SchemaInfo("Id", CachedTypes.Guid); schema.DatabaseGeneratedOption = StoreGeneratedPattern.None; schema.DefaultValue = Guid.Empty.ToString(); schema.IsKey = true; schema.IsNullable = false; schema.MaxLength = 32; schema.ReadOnly = false; schema.SqlValueType = SqlValueType.Parameterized;; string xml = schema.XmlSerialize(); SchemaInfo copy = schema.Copy(); Stopwatch bench = Stopwatch.StartNew(); for (int j = 0; j < 100; ++j) copy = schema.Copy(); bench.Stop(); Debug.WriteLine("Schema Xml Copy: " + bench.ElapsedMilliseconds); Assert.IsNotNull(copy); }