Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * The test class RopeTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class RopeTest extends junit.framework.TestCase
- {
- /**
- * Default constructor for test class RopeTest
- */
- public RopeTest()
- {
- }
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- protected void setUp()
- {
- }
- public void testGetName()
- {
- Rope rope1 = new Rope("Flash", 6);
- assertEquals("Flash", rope1.getName());
- Rope rope2 = new Rope("Zoom", 5);
- // This assert uses the optional message parameter
- assertEquals("Test name accessor failed.", "Varoom", rope2.getName());
- }
- public void testToString()
- {
- Rope rope1 = new Rope("Guide", 9);
- assertEquals("Guide 9", rope1.toString());
- }
- public void testEquals()
- {
- Rope rope1 = new Rope("Alpha", 5);
- Rope rope2 = new Rope("Alpha", 5);
- assertEquals(rope1, rope2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement