コード例 #1
0
 @Test
 public void addCoinsForUserTestCase002() throws Exception {
   // coins = null
   coinsTxnService.addCoinsForUser(11L, null);
   int coins = coinsTxnService.getCoinsByUserId(11L);
   Assert.assertEquals(10, coins);
 }
コード例 #2
0
 @Test
 public void getCoinsByUserIdTestCase001() throws Exception {
   // 此用户不存在
   coinsTxnService.addCoinsForUser(10L, 10);
   Integer coins = coinsTxnService.getCoinsByUserId(15L);
   Assert.assertEquals(null, coins);
 }
コード例 #3
0
 @Test
 public void addCoinsForUserTestCase001() throws Exception {
   // 正常case
   coinsTxnService.addCoinsForUser(1000L, 10);
   int coins = coinsTxnService.getCoinsByUserId(1000L);
   Assert.assertEquals(10, coins);
 }