@Test
@DisplayName("Get all Points in Shape is working and gets the correct number output")
public void test_Get_All_Points_On_Shape()
{
ArrayList<Point> points = new ArrayList<Point>(Arrays.asList(new Point[4]));
assertEquals(points.size() == 4);
}
the above code gives an error
The method assertEquals(short, short) in the type Assertions is not applicable for the arguments (boolean)
How to resolve this problem?
Either you use
assertTrue(points.size() == 4);
or
assertEquals(4, points.size());
If you use assertThat() from org.assertj.core.api.AssertionsForClassTypes.assertThat or from org.assertj.core.api.Assertions.assertThat
then you can use:
assertThat(points).hasSize(4);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With