# refactoring-improving-the-design-of-existing-code **Repository Path**: yunweizhaoyang/refactoring-improving-the-design-of-existing-code ## Basic Information - **Project Name**: refactoring-improving-the-design-of-existing-code - **Description**: 《重构-改善既有代码设计》的源码 万丈高楼平地起!基本功是能写出优秀代码的源泉!这是我边读边整理的源码 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2019-09-30 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # refactoring-improving-the-design-of-existing-code ---------- ---------- ## Chapter01 ## 测试代码 ```java package chapter0101; import org.testng.annotations.Test; public class CustomerTest { @Test public void statement() { Customer customer = new Customer("John"); String title = "Titanic"; int priceCode = 2; int _daysRented = 7; Movie movie = new Movie(title, priceCode); Rental rental = new Rental(movie, _daysRented); customer.addRental(rental); String result = customer.statement(); System.out.println(result); } } ``` 测试结果: ```sql [RemoteTestNG] detected TestNG version 6.12.0 Rental Record for John Titanic 7.5 Amount owed is 7.5 You earned 1 frequent renter points PASSED: statement =============================================== Default test Tests run: 1, Failures: 0, Skips: 0 =============================================== =============================================== Default suite Total tests run: 1, Failures: 0, Skips: 0 =============================================== ```