Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions