(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestLeftJoin(t *testing.T) { |
| 77 | customers, orders := sampleForJoin() |
| 78 | |
| 79 | dt, err := customers.LeftJoin(orders, datatable.On("[Customers].[id]", "[Orders].[user_id]")) |
| 80 | assert.NoError(t, err) |
| 81 | assert.NotNil(t, dt) |
| 82 | |
| 83 | checkTable(t, dt, |
| 84 | "id", "prenom", "nom", "email", "ville", "date_achat", "num_facture", "prix_total", |
| 85 | 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", time.Date(2013, time.January, 23, 0, 0, 0, 0, time.UTC), "A00103", 203.14, |
| 86 | 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", time.Date(2013, time.February, 14, 0, 0, 0, 0, time.UTC), "A00104", 124.00, |
| 87 | 2, "Esmée", "Lefort", "esmee.lefort@example.com", "Lyon", time.Date(2013, time.February, 17, 0, 0, 0, 0, time.UTC), "A00105", 149.45, |
| 88 | 3, "Marine", "Prevost", "m.prevost@example.com", "Lille", time.Date(2013, time.February, 21, 0, 0, 0, 0, time.UTC), "A00106", 235.35, |
| 89 | 4, "Luc", "Rolland", "lucrolland@example.com", "Marseille", nil, nil, nil, |
| 90 | ) |
| 91 | } |
| 92 | |
| 93 | func TestRightJoin(t *testing.T) { |
| 94 | customers, orders := sampleForJoin() |
nothing calls this directly
no test coverage detected