(t *testing.T)
| 62 | } |
| 63 | |
| 64 | func TestPlainStructLoad(t *testing.T) { |
| 65 | |
| 66 | db := getLanguagesDb() |
| 67 | |
| 68 | lsql := &Language{} |
| 69 | if res, err := db.Exec("INSERT INTO languages (name, version, dt_release) VALUES ('Scala', '2.11.7', '2015-06-23')"); err != nil { |
| 70 | t.Fatalf("Sqlite Exec failed: %s", err) |
| 71 | } else if lsql.Id, err = res.LastInsertId(); err != nil { |
| 72 | t.Fatalf("Sqlite LastInsertId failed: %s", err) |
| 73 | } |
| 74 | |
| 75 | l := &Language{Id: lsql.Id} |
| 76 | l.Recorder = New(squirrel.NewStmtCacheProxy(db), "mysql").Bind("languages", l) |
| 77 | if err := l.Load(); err != nil { |
| 78 | t.Fatalf("Failed Load: %s", err) |
| 79 | } |
| 80 | |
| 81 | lsql.Name = "Scala" |
| 82 | lsql.Version = "2.11.7" |
| 83 | lsql.DtRelease = time.Date(2015, time.June, 23, 0, 0, 0, 0, time.UTC) |
| 84 | if !l.equals(lsql) { |
| 85 | t.Fatal("Loaded and inserted objects should be equivalent") |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | func TestPlainStructLoadWhere(t *testing.T) { |
| 90 |
nothing calls this directly
no test coverage detected