Implemented rest of track tests
This commit is contained in:
parent
ae4d863dd2
commit
9160c02bee
|
@ -21,16 +21,20 @@ type TrackTestSuite struct {
|
||||||
|
|
||||||
func (suite *TrackTestSuite) SetupTest() {
|
func (suite *TrackTestSuite) SetupTest() {
|
||||||
duration, _ := time.ParseDuration("1s")
|
duration, _ := time.ParseDuration("1s")
|
||||||
|
offset, _ := time.ParseDuration("2ms")
|
||||||
suite.Track = Track{
|
suite.Track = Track{
|
||||||
ID: "id",
|
ID: "id",
|
||||||
Title: "title",
|
URL: "url",
|
||||||
Author: "author",
|
Title: "title",
|
||||||
Submitter: "submitter",
|
Author: "author",
|
||||||
Service: "service",
|
AuthorURL: "author_url",
|
||||||
Filename: "filename",
|
Submitter: "submitter",
|
||||||
ThumbnailURL: "thumbnailurl",
|
Service: "service",
|
||||||
Duration: duration,
|
Filename: "filename",
|
||||||
Playlist: new(Playlist),
|
ThumbnailURL: "thumbnailurl",
|
||||||
|
Duration: duration,
|
||||||
|
PlaybackOffset: offset,
|
||||||
|
Playlist: new(Playlist),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +42,10 @@ func (suite *TrackTestSuite) TestGetID() {
|
||||||
suite.Equal("id", suite.Track.GetID())
|
suite.Equal("id", suite.Track.GetID())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *TrackTestSuite) TestGetURL() {
|
||||||
|
suite.Equal("url", suite.Track.GetURL())
|
||||||
|
}
|
||||||
|
|
||||||
func (suite *TrackTestSuite) TestGetTitle() {
|
func (suite *TrackTestSuite) TestGetTitle() {
|
||||||
suite.Equal("title", suite.Track.GetTitle())
|
suite.Equal("title", suite.Track.GetTitle())
|
||||||
}
|
}
|
||||||
|
@ -46,6 +54,10 @@ func (suite *TrackTestSuite) TestGetAuthor() {
|
||||||
suite.Equal("author", suite.Track.GetAuthor())
|
suite.Equal("author", suite.Track.GetAuthor())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *TrackTestSuite) TestGetAuthorURL() {
|
||||||
|
suite.Equal("author_url", suite.Track.GetAuthorURL())
|
||||||
|
}
|
||||||
|
|
||||||
func (suite *TrackTestSuite) TestGetSubmitter() {
|
func (suite *TrackTestSuite) TestGetSubmitter() {
|
||||||
suite.Equal("submitter", suite.Track.GetSubmitter())
|
suite.Equal("submitter", suite.Track.GetSubmitter())
|
||||||
}
|
}
|
||||||
|
@ -88,6 +100,12 @@ func (suite *TrackTestSuite) TestGetDuration() {
|
||||||
suite.Equal(duration, suite.Track.GetDuration())
|
suite.Equal(duration, suite.Track.GetDuration())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *TrackTestSuite) TestGetPlaybackOffset() {
|
||||||
|
duration, _ := time.ParseDuration("2ms")
|
||||||
|
|
||||||
|
suite.Equal(duration, suite.Track.GetPlaybackOffset())
|
||||||
|
}
|
||||||
|
|
||||||
func (suite *TrackTestSuite) TestGetPlaylistWhenExists() {
|
func (suite *TrackTestSuite) TestGetPlaylistWhenExists() {
|
||||||
result := suite.Track.GetPlaylist()
|
result := suite.Track.GetPlaylist()
|
||||||
|
|
||||||
|
|
Reference in a new issue