Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handling both relative and absolute URLs as podcast thumbnails
- Loading branch information
1 parent
6a3888d
commit 253acef
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
Radio-T-Test/src/org/dandelion/radiot/unittest/ThumbnailUriTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.dandelion.radiot.unittest; | ||
|
||
import junit.framework.TestCase; | ||
import org.dandelion.radiot.podcasts.core.RssFeedModel; | ||
|
||
public class ThumbnailUriTestCase extends TestCase { | ||
public void testConstructFromCompleteUrl() throws Exception { | ||
String url = RssFeedModel.ThumbnailUrl.construct("http://www.radio-t.com/thumbnail.jpg"); | ||
assertEquals("http://www.radio-t.com/thumbnail.jpg", url); | ||
} | ||
|
||
public void testConstructFromRelativeUrl() throws Exception { | ||
String url = RssFeedModel.ThumbnailUrl.construct("/thumbnail.jpg"); | ||
assertEquals("http://www.radio-t.com/thumbnail.jpg", url); | ||
} | ||
|
||
public void testNoUrl() throws Exception { | ||
assertNull(RssFeedModel.ThumbnailUrl.construct(null)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters