(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestPlugin_RecordsQueriesOnQuery(t *testing.T) { |
| 52 | db := openTestDB(t) |
| 53 | plugin := gosqlxgorm.NewPlugin() |
| 54 | if err := db.Use(plugin); err != nil { |
| 55 | t.Fatal(err) |
| 56 | } |
| 57 | |
| 58 | var users []User |
| 59 | db.Find(&users) |
| 60 | |
| 61 | stats := plugin.Stats() |
| 62 | if stats.TotalQueries == 0 { |
| 63 | t.Error("expected at least one recorded query") |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func TestPlugin_RecordsTableName(t *testing.T) { |
| 68 | db := openTestDB(t) |
nothing calls this directly
no test coverage detected