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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started