|
| 1 | +package org.teachingkidsprogramming.section08events; |
| 2 | + |
| 3 | +import java.awt.Cursor; |
| 4 | + |
| 5 | +import org.junit.Assert; |
| 6 | +import org.junit.Test; |
| 7 | +import org.teachingextensions.logo.Tortoise; |
| 8 | +import org.teachingextensions.logo.utils.ColorUtils.PenColors; |
| 9 | +import org.teachingextensions.logo.utils.LineAndShapeUtils.Circle; |
| 10 | + |
| 11 | +@SuppressWarnings("unused") |
| 12 | +public class DeepDive08Events |
| 13 | +{ |
| 14 | + // Step 1: SELECT the method name (twoTortoises on line 26), then click the Run Button |
| 15 | + // Keyboard shortcut to run -> PC: Ctrl+F11 or Mac: Command+fn+F11 |
| 16 | + // Step 2: READ the name of the method that failed |
| 17 | + // Step 3: FILL IN the blank (___) to make that method pass |
| 18 | + // Step 4: SAY at least one thing you just learned |
| 19 | + // Step 5: GO to the next method |
| 20 | + // |
| 21 | + // NOTE: Do not change anything except the blank (___) |
| 22 | + // |
| 23 | + //*****************In Progress************************// |
| 24 | + //Looking at testing types of Asserts - more http://junit.sourceforge.net/javadoc/org/junit/Assert.html |
| 25 | + //Also testing more events |
| 26 | + //NOTE for Deep Dive Authors: Copy 'answer' to TKPJava answer section when done |
| 27 | + // |
| 28 | + @Test |
| 29 | + public void twoCircles() throws Exception |
| 30 | + { |
| 31 | + Circle c1 = new Circle(20, PenColors.Blues.Blue); |
| 32 | + Circle c2 = new Circle(20, PenColors.Blues.Blue); |
| 33 | + boolean result = c1.equals(c2); |
| 34 | + Assert.assertEquals(_____, result); |
| 35 | + } |
| 36 | + @Test |
| 37 | + public void twoCirclesAgain() throws Exception |
| 38 | + { |
| 39 | + Circle c1 = new Circle(20, PenColors.Blues.Blue); |
| 40 | + Circle c2 = new Circle(20, PenColors.Blues.Blue); |
| 41 | + boolean result = c2.equals(c1); |
| 42 | + Assert.assertNotSame(_____, result); |
| 43 | + } |
| 44 | + /** |
| 45 | + * Ignore the following, It's needed to run the deep dive |
| 46 | + * |
| 47 | + * |
| 48 | + * |
| 49 | + * |
| 50 | + * |
| 51 | + * |
| 52 | + * |
| 53 | + * |
| 54 | + * |
| 55 | + * |
| 56 | + */ |
| 57 | + public boolean _____ = false; |
| 58 | + public boolean ______ = true; |
| 59 | + public String ___ = "You need to fill in the blank ___"; |
| 60 | + public int ____ = 0; |
| 61 | + public String ___() |
| 62 | + { |
| 63 | + return ___; |
| 64 | + } |
| 65 | + private Cursor getCursor() |
| 66 | + { |
| 67 | + Cursor cursor = Tortoise.getBackgroundWindow().getCursor(); |
| 68 | + return cursor; |
| 69 | + } |
| 70 | +} |
0 commit comments