コード例 #1
0
 @Test
 public void testKey() {
   MessageService ms = MessageService.getInstance();
   String key = "MSG0001";
   Assert.assertEquals(
       "Not correctly returning message from file.",
       ms.getMessage(key),
       "MSG0001 Argument cannot be null.");
 }
コード例 #2
0
 @Test
 public void testKeyNotFound() {
   MessageService ms = MessageService.getInstance();
   String falseKey = "foo";
   Assert.assertEquals(
       "Should return false key (" + falseKey + ") as key doesnt exist in message file",
       ms.getMessage(falseKey),
       falseKey);
 }