12345678910111213141516171819202122 |
- package feed
- import (
- "github.com/stretchr/testify/assert"
- "golang.org/x/tools/blog/atom"
- "testing"
- )
- func TestGetAtomFeed(t *testing.T) {
- var initfeed atom.Feed
- assert := assert.New(t)
- correctfeed, err := GetAtomFeed("https://blog.mavjs.org/feeds/all.atom.xml")
- assert.NotEmpty(correctfeed, "the returned feed should not be empty")
- assert.NoError(err, "there should be no error")
- incorrectfeed, err := GetAtomFeed("https://blog.mavjs.org/feeds/nall.atom.xml")
- assert.IsType(initfeed, incorrectfeed, "they should be the same type")
- assert.Error(err, "there should be an error")
- }
|