Assertion

Report a typo

Suppose you have the following Calculator class:

public class Calculator {

    public int add(int a, int b) {
        return a + b;
    }
}

Implement the corresponding test method using the Assertions.assertEquals(int expected, int actual) static method and a suitable test case at your discretion to verify that the add method of the Calculator class works correctly. Please do not add any annotations or import any packages.

Write a program in Java 17





___

Create a free account to access the full topic