### Question:
DebugSmsSender extends AbstractSmsSender { public String getMsgHistory(String phone) { return msgHistory.get(phone); }  String getMsgHistory(String phone); String removeMsgHistory(String phone); String doSend(String content, String phoneNo, SmsMsgSendType smsMsgSendType); @Override boolean is4Debug();  }### Answer:
@Test public void testSender_1() { String from = "13621603604"; String[] to = { "13621603604" }; String content = "##this is a test##"; MobileMessage message = new MobileMessage(from, to, content); DebugSmsSender sender = new DebugSmsSender(); sender.IS_UNIT_TEST = true; try { sender.send(message); Assert.assertEquals(content, sender.getMsgHistory(to[0])); } catch (Exception e) { } }
@Test(expected = IllegalArgumentException.class) public void testSender_2() { String from = "13621603604"; String[] to = { "13621603604" }; String content = null; MobileMessage message = new MobileMessage(from, to, content); DebugSmsSender sender = new DebugSmsSender(); sender.IS_UNIT_TEST = true; sender.send(message); Assert.assertEquals(content, sender.getMsgHistory(to[0])); }
@Test(expected = IllegalArgumentException.class) public void testSender_3() { String from = "13621603604"; String[] to = { "1362160360x" }; String content = null; MobileMessage message = new MobileMessage(from, to, content); DebugSmsSender sender = new DebugSmsSender(); sender.send(message); Assert.assertNull(sender.getMsgHistory(to[0])); }
@Test(expected = IllegalArgumentException.class) public void testSender_4() { String from = "13621603604"; String[] to = { "13621603604" }; String content = null; MobileMessage message = new MobileMessage(from, to, content); DebugSmsSender sender = new DebugSmsSender(); sender.IS_UNIT_TEST = true; sender.send(message); Assert.assertNull(sender.getMsgHistory(to[0])); }
@Test(expected = IllegalArgumentException.class) public void testSender_5() { String from = "13621603604"; String[] to = { "13621603604" }; String content = "A journey of a thousand miles begins with the first step! A journey of a thousand miles begins with the first step! A journey of a thousand miles begins with the first step! A journey of a thousand miles begins with the first step! A journey of a thousand miles begins with the first step! A journey of a thousand miles begins with the first step! "; MobileMessage message = new MobileMessage(from, to, content); DebugSmsSender sender = new DebugSmsSender(); sender.IS_UNIT_TEST = true; try { sender.send(message); Assert.assertEquals(content, sender.getMsgHistory(to[0])); } catch (Exception e) { } }