package test.myUnitTest.fine.tasting;
import myUnitTest.fine.tasting.*;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import junit.framework.JUnit4TestAdapter;
public class TestAccountService {
@Test public void transferOk(){
MockAccountManager mockAccountManager =
new MockAccountManager();
Account senderAccount = new Account("1", 200 );
Account beneficiaryAccount = new Account("2", 100 );
mockAccountManager.addAccount("1", senderAccount);
mockAccountManager.addAccount("2", beneficiaryAccount);
AccountService accountService = new AccountService();
accountService.setAccountManager(mockAccountManager);
accountService.transfer("1", "2", 50);
assertEquals( (long)150,(senderAccount.getBalance() )); assertEquals( (long)150, (beneficiaryAccount.getBalance()) );
//原书
// assertEquals( 150,(senderAccount.getBalance() ));
//assertEquals( 150, (beneficiaryAccount.getBalance()) );
}
}
分享到:
相关推荐
JUnit in Action中文版JUnit in Action中文版JUnit in Action中文版JUnit in Action中文版
JUnit in Action 中文版电子书
junit in action 中文版
junit in action 第2版源码,使用maven构件工程
Manning的in Action,是一套非常实用的书,能够帮助读者对相关技术快速上手。 这一本是JUnit in Action第二版的,由于这不是正式发售的版本,属于测试版本,因此书中可能存在一些缺陷。
JUnit in Action中文版
JUnit In Action 第二版源码 第一部分
Junit in Action 中文版--带目录
JUnit in Action 3nd Edition
junit in action 源码 java版
JUnit in Action中文版,用于java单元测试
介绍junit的中文版电子书,是很不错的学习测试用的资料。
JUnit In Action 第二版源码 第二部分
JUnit+in+Action中文版 JUnit实战
junit in action 第二版 manning出版
JUnit.in.Action中文版(3)
JunitInAction书中的源代码,便于Java开发者和测试人员使用Junit框架从代码层面进行白盒测试。
JUnit in Action 中文版英文版 JUnit Recipies好书哦!
JUnit in Action is an example-driven, how-to book on unit-testing Java applications, including J2EE applications, using the JUnit framework and its extensions. This book is intended for readers who ...