Example #1
0
func allTracks(ctx *_Context) error {
	tracks, err := table.FindAllTracks()
	if err != nil {
		return err
	}

	ctx.resp = response.TrackResponses(tracks)
	return nil
}
Example #2
0
func TestFindAllTracks(t *T) {
	beforeTrackTest()

	tracks, err := table.FindAllTracks()
	rdtest.Assert(t, err == nil, err)
	rdtest.Assert(t, len(tracks) == 3, "3 != %d", len(tracks))
	rdtest.Assert(t, tracks[0].TrackId == 1)
	rdtest.Assert(t, tracks[1].TrackId == 2)
	rdtest.Assert(t, tracks[2].TrackId == 3)
}