diff --git a/bot/track_test.go b/bot/track_test.go index fc9c15d..863a140 100644 --- a/bot/track_test.go +++ b/bot/track_test.go @@ -21,16 +21,20 @@ type TrackTestSuite struct { func (suite *TrackTestSuite) SetupTest() { duration, _ := time.ParseDuration("1s") + offset, _ := time.ParseDuration("2ms") suite.Track = Track{ - ID: "id", - Title: "title", - Author: "author", - Submitter: "submitter", - Service: "service", - Filename: "filename", - ThumbnailURL: "thumbnailurl", - Duration: duration, - Playlist: new(Playlist), + ID: "id", + URL: "url", + Title: "title", + Author: "author", + AuthorURL: "author_url", + Submitter: "submitter", + Service: "service", + Filename: "filename", + ThumbnailURL: "thumbnailurl", + Duration: duration, + PlaybackOffset: offset, + Playlist: new(Playlist), } } @@ -38,6 +42,10 @@ func (suite *TrackTestSuite) TestGetID() { suite.Equal("id", suite.Track.GetID()) } +func (suite *TrackTestSuite) TestGetURL() { + suite.Equal("url", suite.Track.GetURL()) +} + func (suite *TrackTestSuite) TestGetTitle() { suite.Equal("title", suite.Track.GetTitle()) } @@ -46,6 +54,10 @@ func (suite *TrackTestSuite) TestGetAuthor() { suite.Equal("author", suite.Track.GetAuthor()) } +func (suite *TrackTestSuite) TestGetAuthorURL() { + suite.Equal("author_url", suite.Track.GetAuthorURL()) +} + func (suite *TrackTestSuite) TestGetSubmitter() { suite.Equal("submitter", suite.Track.GetSubmitter()) } @@ -88,6 +100,12 @@ func (suite *TrackTestSuite) TestGetDuration() { suite.Equal(duration, suite.Track.GetDuration()) } +func (suite *TrackTestSuite) TestGetPlaybackOffset() { + duration, _ := time.ParseDuration("2ms") + + suite.Equal(duration, suite.Track.GetPlaybackOffset()) +} + func (suite *TrackTestSuite) TestGetPlaylistWhenExists() { result := suite.Track.GetPlaylist()