Download this file
| 1 | package idear |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | // TestModels checks that models (unexported — see Schema's doc |
| 6 | // comment for why an app must never be handed this list) returns |
| 7 | // pointers to both idear model types, in the shape idear's own tests |
| 8 | // use to check Schema and the struct tags agree. |
| 9 | func TestModels(t *testing.T) { |
| 10 | got := models() |
| 11 | if len(got) != 2 { |
| 12 | t.Fatalf("len(models()) = %d, want 2", len(got)) |
| 13 | } |
| 14 | if _, ok := got[0].(*Member); !ok { |
| 15 | t.Errorf("models()[0] = %T, want *Member", got[0]) |
| 16 | } |
| 17 | if _, ok := got[1].(*Invitation); !ok { |
| 18 | t.Errorf("models()[1] = %T, want *Invitation", got[1]) |
| 19 | } |
| 20 | } |
| 21 | |