@Test public void testGetFullName() { VirtualProctor.internals.resetClassName(); VirtualProctor.internals.resetName(); VirtualProctor.setName("Jason"); VirtualProctor.setClassName("BoardGames"); assertEquals("BoardGames.Jason", VirtualProctor.internals.getFullName()); }
/** * Makes a cool shape fast <div><b>Example: </b> {@code tortoise.drawShape(6,PenColors.Reds.Red, * 50, 20)}</div> * * @param sides the number of sides * @param color a snazzy line color * @param length the bigger the better * @param width make a thick line - it's cool */ public static void drawShape(int sides, Color color, int length, int width) { Tortoise.show(); Tortoise.setSpeed(7); Tortoise.getBackgroundWindow().setBackground(PenColors.Yellows.Goldenrod); new Text("TKP Java - Make Some Shapes!") .setTopLeft(225, 50) .addTo(Tortoise.getBackgroundWindow()); for (int i = 0; i < sides; i++) { Tortoise.setPenColor(color); Tortoise.setPenWidth(width); Tortoise.move(length); Tortoise.turn(360 / sides); } VirtualProctor.setClassName("Grace Hopper's Class"); VirtualProctor.setName("Jean Bartik"); }
@Test public void testSetName() throws Exception { VirtualProctor.internals.resetName(); VirtualProctor.setName("Lynn"); assertEquals("Lynn", VirtualProctor.internals.getName()); }
@Test public void testSetClassName() { VirtualProctor.internals.resetClassName(); VirtualProctor.setClassName("Mob"); assertEquals("Mob", VirtualProctor.internals.getClassName()); }