================== Create tests ================================
(t *testing.T)
| 57 | |
| 58 | // ================== Create tests ================================ |
| 59 | func TestUserCreate(t *testing.T) { |
| 60 | for _, user := range testData.Users { |
| 61 | if err := adp.UserCreate(user); err != nil { |
| 62 | t.Error(err) |
| 63 | } |
| 64 | } |
| 65 | var count int |
| 66 | |
| 67 | if err := db.Ping(); err != nil { |
| 68 | logs.Err.Println("Database ping failed:", err) |
| 69 | } |
| 70 | err := db.QueryRow("SELECT COUNT(*) FROM users").Scan(&count) |
| 71 | if err != nil { |
| 72 | t.Error(err) |
| 73 | } |
| 74 | if count == 0 { |
| 75 | t.Error("No users created!") |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func TestCredUpsert(t *testing.T) { |
| 80 | // Test just inserts: |
nothing calls this directly
no test coverage detected
searching dependent graphs…