Skip to content

Commit e5241a2

Browse files
committed
adding to DD8
1 parent b1c81ed commit e5241a2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
0 Bytes
Binary file not shown.

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ public void stringsCanBeReversedInStringBuilder() throws Exception
5656
String result = sb.toString();
5757
Assert.assertEquals(___, result);
5858
}
59+
@Test
60+
public void numbersCanBeStrings() throws Exception
61+
{
62+
StringBuilder sb = new StringBuilder();
63+
for (int i = 97; i <= 99; i++)
64+
{
65+
sb.append(convertArray(i));
66+
}
67+
String result = sb.toString();
68+
Assert.assertEquals(___, result);
69+
}
5970
/**
6071
* Ignore the following, It's needed to run the homework
6172
*
@@ -82,4 +93,8 @@ private Cursor getCursor()
8293
Cursor cursor = Tortoise.getBackgroundWindow().getCursor();
8394
return cursor;
8495
}
96+
public static String convertArray(int i)
97+
{
98+
return " " + i;
99+
}
85100
}

0 commit comments

Comments
 (0)