(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestPlainStructInsert(t *testing.T) { |
| 43 | |
| 44 | db := getLanguagesDb() |
| 45 | |
| 46 | l := &Language{ |
| 47 | Id: -1, |
| 48 | Name: "Go", |
| 49 | Version: "1.3", |
| 50 | DtRelease: time.Date(2014, time.June, 18, 0, 0, 0, 0, time.UTC)} |
| 51 | l.Recorder = New(squirrel.NewStmtCacheProxy(db), "mysql").Bind("languages", l) |
| 52 | |
| 53 | if err := l.Insert(); err != nil { |
| 54 | t.Fatalf("Failed Insert: %s", err) |
| 55 | } |
| 56 | |
| 57 | lsql := new(Language) |
| 58 | lsql.loadFromSql(l.Id, db) |
| 59 | if !l.equals(lsql) { |
| 60 | t.Fatal("Loaded and inserted objects should be equivalent") |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func TestPlainStructLoad(t *testing.T) { |
| 65 |
nothing calls this directly
no test coverage detected