Listing 3. JUnit test for deposit method.
JUnit的deposit方法测试。
Add a method to TestCase that will test the deposit method on Account. The test class should now look like Listing 1.
向TestCase添加一种方法将测试Account的deposit方法。
Now add another assertion to the test case to test the new balance after somebody calls the deposit() method. The testDeposit() method should now look like Listing 3
现在向测试案例添加另一种断言,以在某些人调用 deposit()方法后测试新的余额。
Now add another assertion to the test case to test the new balance after somebody calls the deposit() method. The testDeposit() method should now look like Listing 3
现在向测试案例添加另一种断言,以在某些人调用 deposit()方法后测试新的余额。
应用推荐