Skip to content

wannalL/refactoring-improving-the-design-of-existing-code

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

refactoring-improving-the-design-of-existing-code



Chapter01

测试代码

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);
	}
}

测试结果:

[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
===============================================

About

重构 改善既有代码的设计 源代码

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 58.7%
  • HTML 28.8%
  • CSS 7.5%
  • JavaScript 5.0%