I have a method whose signature is:
void method1(int i,int j);
Now I wish to create a JUnit test case for this method, but I am not sure as to how I should make it.
I am a novice at Java, so please excuse me.
I know I need to use assertEquals() but I am not sure as to how I should use it.
Can someone please help me?
The fact that the method return void, is usually not a problem.
You need to think on how this method changes the state of your object and how you can retrieve this change in state.
Maybe you class has some getter method and you can call your assert on this one.
Sometimes it can even be the
toString()of you class that you need to Assert.If you post some code i can adapt my answer to be more concrete.