Exemplo n.º 1
0
 public void TestInsertClass2Muti()
 {
     try
     {
         TestDropTableWithoutAttr();
     }
     catch { }
     try
     {
         TestCreateTableWithoutAttr();
         var Dbc = new NLORMMySqlDb(connectionString);
         for (int i = 0; i < 10; i++)
         {
             var c1 = new TestClass2();
             c1.ID = "id" + i.ToString();
             Dbc.Insert<TestClass2>(c1);
         }
         var result = Dbc.Query<TestClass2>("SELECT * FROM  TestClass2");
         Assert.AreEqual(result.Count(), 10);
     }
     catch (MySqlException ex)
     {
         Assert.IsTrue(ex is MySqlException);
     }
 }