Question: Using SquareTests as your starting point, expand the test methods to include more cases for area() and getLength(). Add a test method for perimeter() as
Using SquareTests as your starting point, expand the test methods to include more cases for area() and getLength(). Add a test method for perimeter() as well. Note: you should instantiate a few more Squares with different lengths in order to test different cases. Write a TriangleTests test class to test the Triangle class in a similar manner. (JAVA)
SquareTests:
import static org.junit.jupiter.api.Assertions.*; import org.junit.runner.RunWith; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach;
public class SquareTests { private Square square1;
@BeforeEach public void setUp(){ square1 = new Square(0); }
@Test public void testArea() { assertEquals(0.0, square1.area(), 0.000000001); }
@Test public void testLength() { assertEquals(square1.getLength(), 0.0, 0.000000001); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
