2017-02-02 07:42:33 -05:00
|
|
|
package podcast_test
|
|
|
|
|
|
|
|
import (
|
2020-02-06 21:25:25 -05:00
|
|
|
"testing"
|
|
|
|
|
2020-12-21 09:45:20 -05:00
|
|
|
"github.com/arenzana/podcast"
|
2017-02-02 07:42:33 -05:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2017-02-04 13:15:18 -05:00
|
|
|
type enclosureTest struct {
|
|
|
|
t podcast.EnclosureType
|
|
|
|
expected string
|
2017-02-02 07:42:33 -05:00
|
|
|
}
|
|
|
|
|
2017-02-04 13:15:18 -05:00
|
|
|
var enclosureTests = []enclosureTest{
|
2020-02-06 21:25:25 -05:00
|
|
|
{podcast.M4A, "audio/x-m4a"},
|
|
|
|
{podcast.M4V, "video/x-m4v"},
|
|
|
|
{podcast.MP4, "video/mp4"},
|
|
|
|
{podcast.MP3, "audio/mpeg"},
|
|
|
|
{podcast.MOV, "video/quicktime"},
|
|
|
|
{podcast.PDF, "application/pdf"},
|
|
|
|
{podcast.EPUB, "document/x-epub"},
|
|
|
|
{podcast.M4A, "audio/x-m4a"},
|
|
|
|
{99, "application/octet-stream"},
|
2017-02-02 07:42:33 -05:00
|
|
|
}
|
|
|
|
|
2017-02-04 13:15:18 -05:00
|
|
|
func TestEnclosureTypes(t *testing.T) {
|
2017-02-02 07:42:33 -05:00
|
|
|
t.Parallel()
|
2017-02-04 13:15:18 -05:00
|
|
|
for _, et := range enclosureTests {
|
|
|
|
et := et
|
|
|
|
t.Run(et.t.String(), func(t *testing.T) {
|
|
|
|
t.Parallel()
|
2017-02-02 07:42:33 -05:00
|
|
|
|
2017-02-04 13:15:18 -05:00
|
|
|
assert.EqualValues(t, et.expected, et.t.String())
|
|
|
|
})
|
|
|
|
}
|
2017-02-02 07:42:33 -05:00
|
|
|
}
|