RectangleTest - a } @Test public void testGetPerimeter() {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab09; p import static org.junit.Assert.*; i import org.junit.Test; i public class RectangleTest { p @Test public void testRectangle() { Rectangle r = new Rectangle(5, 4); assertEquals("width", 5, r.getWidth()); assertEquals("height", 4, r.getHeight()); a } @Test public void testGetArea() { Rectangle r = new Rectangle(5, 4); assertEquals("area", 20, r.getArea());
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a } @Test public void testGetPerimeter() { Rectangle r = new Rectangle(5, 4); assertEquals("perimeter", 14, r.getPerimeter()); } @Test public void testIsSquare() { Rectangle r = new Rectangle(5, 5); assertTrue("square", r.isSquare()); r = new Rectangle(3, 5); assertFalse("non-square", r.isSquare()); a } }...
View Full Document

Ask a homework question - tutors are online