Skip to content

Commit fcbf51d

Browse files
committed
added to DD8
1 parent da5fe4e commit fcbf51d

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed
0 Bytes
Binary file not shown.

TeachingKidsProgramming/src/org/teachingkidsprogramming/section08tdd/DeepDive08TDD.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ public void numbersCanBeStrings() throws Exception
6868
Assert.assertEquals(___, result);
6969
}
7070
@Test
71+
public void numbersCanBeStringsAgain() throws Exception
72+
{
73+
StringBuilder sb = new StringBuilder();
74+
for (int i = 99; i > ____; i--)
75+
{
76+
sb.append(convertArray(i));
77+
}
78+
String result = sb.toString();
79+
Assert.assertEquals(" 99 98 97", result);
80+
}
81+
@Test
7182
public void theLineEndsWhenItEnds() throws Exception
7283
{
7384
StringBuilder sb = new StringBuilder("one end ");
@@ -76,6 +87,16 @@ public void theLineEndsWhenItEnds() throws Exception
7687
String result = sb.toString();
7788
Assert.assertEquals(___, result);
7889
}
90+
@Test
91+
public void theLineEndsReally() throws Exception
92+
{
93+
StringBuilder sb = new StringBuilder("one end ");
94+
sb.append("\n");
95+
sb.append(" another end ");
96+
sb.append(___);
97+
String result = sb.toString();
98+
Assert.assertEquals("one end \n another end \n", result);
99+
}
79100
/**
80101
* Ignore the following, It's needed to run the homework
81102
*
@@ -89,10 +110,11 @@ public void theLineEndsWhenItEnds() throws Exception
89110
*
90111
*
91112
*/
92-
public boolean _____ = false;
93-
public boolean ______ = true;
94-
public String ___ = "You need to fill in the blank ___";
95-
public int ____ = 0;
113+
public boolean _____ = false;
114+
public boolean ______ = true;
115+
public Character _______;
116+
public String ___ = "You need to fill in the blank ___";
117+
public int ____ = 0;
96118
public String ___()
97119
{
98120
return ___;

0 commit comments

Comments
 (0)