File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
TeachingKidsProgramming/src
org/teachingkidsprogramming/section08tdd Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 11package org .teachingkidsprogramming .section08tdd ;
22
3- import java .awt .Color ;
43import java .awt .Cursor ;
54
65import org .junit .Assert ;
76import org .junit .Test ;
87import org .teachingextensions .logo .Tortoise ;
9- //This deepdive is in progress!
108
11- //
9+ //This deepdive is in progress!
1210public class DeepDive08TDD
1311{
1412 // How to do deep dive:
15- // Step 1: Select the method name (doesABear on line 20 ) Press the Run Button
13+ // Step 1: Select the method name (stringsCanBeArrays on line XX ) Press the Run Button
1614 // PC: Ctrl+F11
1715 // Mac: Command+fn+F11
1816 // Step 2: Read the name of the method that failed
@@ -32,6 +30,15 @@ public void stringsCanBeArrays() throws Exception
3230 String result = words [0 ] + words [1 ];
3331 Assert .assertEquals ("happy baby" , result );
3432 }
33+ @ Test
34+ public void stringsCanBePartOfStringBuilder () throws Exception
35+ {
36+ StringBuilder sb = new StringBuilder ();
37+ sb .append ("happy" );
38+ sb .append (" baby" );
39+ String result = sb .toString ();
40+ Assert .assertEquals ("happy baby" , ___ );
41+ }
3542 /**
3643 * Ignore the following, It's needed to run the homework
3744 *
@@ -49,7 +56,6 @@ public void stringsCanBeArrays() throws Exception
4956 public boolean ______ = true ;
5057 public String ___ = "You need to fill in the blank ___" ;
5158 public int ____ = 0 ;
52- public Color _______ ;
5359 public String ___ ()
5460 {
5561 return ___ ;
You can’t perform that action at this time.
0 commit comments