Skip to content

Commit 6225902

Browse files
committed
Added first test! added tons of comments.
1 parent b037696 commit 6225902

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
package processing.core;
22

3-
public class PFontTest {
3+
import java.awt.Font; //Javas built in font class
4+
import org.junit.Test; //Using Junit4 test implementation
5+
import static org.junit.Assert.assertEquals; //To compare expected vs actual values
46

5-
}
7+
public class PFontTest {
68

7-
//Write Tests HERE!
9+
@Test
10+
public void constructor_setsSizeCorrectly() {
11+
Font awtFont = new Font("Dialog", Font.PLAIN, 16); //Truth, what PFont size should be
12+
PFont font = new PFont(awtFont, true, null); //call to constructor w specific values
13+
assertEquals(16, font.getSize()); //actual test, expects 16 compares against actual value
14+
}
15+
}

core/test/processing/core/PFontTestHelp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ What I think we need to test for broken up into chunks... trying to keep it orga
33

44
Chunk A — Construction and initialization
55

6-
EED TO TEST IF...
6+
NEED TO TEST IF...
77

88
the object starts in the correct mode
99
important fields are initialized correctly

0 commit comments

Comments
 (0)