(t *testing.T)
| 304 | } |
| 305 | |
| 306 | func Test_DB_BatchInsert_Struct(t *testing.T) { |
| 307 | // batch insert struct |
| 308 | table := "A_tables" |
| 309 | createInitTable(table) |
| 310 | defer dropTable(table) |
| 311 | gtest.C(t, func(t *gtest.T) { |
| 312 | user := &User{ |
| 313 | ID: 700, |
| 314 | AccountName: "BatchInsert_Struct_700", |
| 315 | CreatedTime: time.Now(), |
| 316 | UpdatedTime: time.Now(), |
| 317 | } |
| 318 | result, err := db.Model(table).Insert(user) |
| 319 | t.AssertNil(err) |
| 320 | n, _ := result.RowsAffected() |
| 321 | t.Assert(n, 1) |
| 322 | }) |
| 323 | } |
| 324 | |
| 325 | func Test_DB_Update(t *testing.T) { |
| 326 | table := "A_tables" |
nothing calls this directly
no test coverage detected
searching dependent graphs…