package twitter4j; import static org.junit.Assert.*; import org.junit.Test; public class TestOEmbedRequest { @Test public void testConstructor() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); assertNotNull(req); } @Test public void testAlignSetter1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setAlign(OEmbedRequest.Align.CENTER); assertTrue(req.toString().contains("align=CENTER")); } @Test public void testAlignSetter2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setAlign(OEmbedRequest.Align.LEFT); assertTrue(req.toString().contains("align=LEFT")); } @Test public void testAlignSetter3() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setAlign(OEmbedRequest.Align.RIGHT); assertTrue(req.toString().contains("align=RIGHT")); } @Test public void testAlignSetter4() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setAlign(OEmbedRequest.Align.NONE); assertTrue(req.toString().contains("align=NONE")); } @Test public void testAlign1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.align(OEmbedRequest.Align.CENTER); assertTrue(req.toString().contains("align=CENTER")); } @Test public void testAlign2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.align(OEmbedRequest.Align.LEFT); assertTrue(req.toString().contains("align=LEFT")); } @Test public void testAlign3() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.align(OEmbedRequest.Align.RIGHT); assertTrue(req.toString().contains("align=RIGHT")); } @Test public void testAlign4() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.align(OEmbedRequest.Align.NONE); assertTrue(req.toString().contains("align=NONE")); } @Test public void testHideMediaSetter1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setHideMedia(true); assertTrue(req.toString().contains("hideMedia=true")); } @Test public void testHideMediaSetter2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setHideMedia(false); assertTrue(req.toString().contains("hideMedia=false")); } @Test public void testHideMedia1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.HideMedia(true); assertTrue(req.toString().contains("hideMedia=true")); } @Test public void testHideMedia2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.HideMedia(false); assertTrue(req.toString().contains("hideMedia=false")); } @Test public void testHideThreadSetter1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setHideThread(true); assertTrue(req.toString().contains("hideThread=true")); } @Test public void testHideThreadSetter2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setHideThread(false); assertTrue(req.toString().contains("hideThread=false")); } @Test public void testHideThread1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.HideThread(true); assertTrue(req.toString().contains("hideThread=true")); } @Test public void testHideThread2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.HideThread(false); assertTrue(req.toString().contains("hideThread=false")); } @Test public void testLangSetter() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); String lang = "nl"; req.setLang(lang); assertTrue(req.toString().contains("lang='" + lang)); } @Test public void testLang() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); String lang = "nl"; req.lang(lang); assertTrue(req.toString().contains("lang='" + lang)); } @Test public void testMaxWidthSetter() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); int maxWidth = 93; req.setMaxWidth(maxWidth); assertTrue(req.toString().contains("maxWidth=" + maxWidth)); } @Test public void testMaxWidth() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); int maxWidth = 93; req.MaxWidth(maxWidth); assertTrue(req.toString().contains("maxWidth=" + maxWidth)); } @Test public void testOmitScriptSetter1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setOmitScript(true); assertTrue(req.toString().contains("omitScript=true")); } @Test public void testOmitScriptSetter2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.setOmitScript(false); assertTrue(req.toString().contains("omitScript=false")); } @Test public void testOmitScript1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.omitScript(true); assertTrue(req.toString().contains("omitScript=true")); } @Test public void testOmitScript2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); req.omitScript(false); assertTrue(req.toString().contains("omitScript=false")); } @Test public void testEquals1() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); assertTrue(req.equals(req)); } @Test public void testEquals2() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); assertFalse(req.equals(null)); } @Test public void testEquals3() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); assertFalse(req.equals("www")); } @Test public void testEquals4() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); assertTrue(req.equals(new OEmbedRequest(statusId, url))); } @Test public void testEquals5() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); OEmbedRequest req2 = new OEmbedRequest(statusId, url); req.align(OEmbedRequest.Align.LEFT); req2.align(OEmbedRequest.Align.RIGHT); assertFalse(req.equals(req2)); } @Test public void testEquals6() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); OEmbedRequest req2 = new OEmbedRequest(statusId, url); req.HideMedia(true); req2.HideMedia(false); assertFalse(req.equals(req2)); } @Test public void testEquals7() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); OEmbedRequest req2 = new OEmbedRequest(statusId, url); req.HideThread(false); req2.HideThread(true); assertFalse(req.equals(req2)); } @Test public void testEquals8() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); OEmbedRequest req2 = new OEmbedRequest(statusId, url); req.lang("nl"); req2.lang("en"); assertFalse(req.equals(req2)); } @Test public void testEquals9() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); OEmbedRequest req2 = new OEmbedRequest(statusId, url); req.MaxWidth(1); req2.MaxWidth(2); assertFalse(req.equals(req2)); } @Test public void testEquals10() { long statusId = 23; String url = "http://www.facebook.com"; OEmbedRequest req = new OEmbedRequest(statusId, url); OEmbedRequest req2 = new OEmbedRequest(statusId, url); req.omitScript(true); req2.omitScript(false); assertFalse(req.equals(req2)); } }