public void InitData() { return; using (var db = new DataPreseterDb()) { //清空所有数据,并重置索引 db.ExecuteSql("truncate table " + db.GetTableName <OperateTestModel>()); //预置测试数据 List <OperateTestModel> models = new List <OperateTestModel>(); for (int i = 1; i < 1001; i++) { db.Add <OperateTestModel>(new OperateTestModel { Key2 = i, StringKey = $"test_{i}", IntKey = i, IntNullKey = null, DateNullKey = DateTime.Now.Date, DateTimeNullKey = DateTime.Now, DoubleNullKey = i, FloatNullKey = i }); } } Assert.True(true); }
//[Fact] public void InitData_OperationTest2() { using (var db = new DataPreseterDb()) { //清空所有数据,并重置索引 db.ExecuteSql("truncate table " + db.GetTableName <OperationTest2>()); //预置测试数据 List <OperationTest2> models = new List <OperationTest2>(); for (int i = 1; i < 10000; i++) { models.Add(new OperationTest2 { Uid = Guid.NewGuid(), StringKey = string.Concat("str_", i) }); } db.Add <OperationTest2>(models); } }