2011年6月10日

【笔记】Eclipse and Java for Total Beginners—007

摘要: Lesson 07 – Create Book ClassCreate BookTest before creating Book classTest Book constructorCreate get and set methods1. 新建一个JUnit test case, name为BookTest, Class under test为空,因为尚未建Book class.2. 建立Book class, 注意目录为src。3. Test-first approach to Book classCreate BookTest class.Create testBook() method 阅读全文

posted @ 2011-06-10 16:38 yf.x 阅读(383) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—006

摘要: Lesson 06 – Using Test-First Development in EclipseUse test-first approach to write the Person toString() methodMethod overridingField Hiding1. toString() methodinherited from Object classreturns a String representation of the objectnormally create for every class2. Test-driven developmentThink abou 阅读全文

posted @ 2011-06-10 15:32 yf.x 阅读(233) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—005

摘要: Lesson 05 – JUnit Testing ContinuedTest Person class – part 2Create test methods for constructor, getName, and getMaximumBooksStatic methods 这里的assertEquals是Static method.当其在所属的Class内部时,可略写Class。 1 package org.totalbeginner.tutorial; 2 3 import org.totoalbeginner.tutorial.Person; 4 5 import junit.fr 阅读全文

posted @ 2011-06-10 09:25 yf.x 阅读(262) 评论(1) 推荐(1)

导航