在Eclipse中使用JUnit4进行单元测试(中级篇
????@Test
????public?void?testAdd()?...{
??????????calculator.add(2);
??????????calculator.add(3);
??????????assertEquals(5,?calculator.getResult());
????}
??????@Before
??????public?void?setUp()?throws?Exception?...{
???????????calculator.clear();
??????}
private?static?Calculator?calculator?=?new?Calculator();