Hi
I'm getting this error while tseting.
here's part of the code :
public void testGetScore()
{
boolean res=false;
int[] expectedscore = new int[2];
expectedscore[0]=1;
expectedscore[0]=2;
ComputeScore.getScore();
int[] actualscore = GameDataModel.getScore();
for(int i=0;i<2;i++)
{
System.out.println("valus is : " +actualscore);
}
assertEquals(expectedscore[0],actualscore[0]);
assertEquals(expectedscore[1],actualscore[1]); //failed
}
the values in actualscore and expected are the same -
just before asserting also i printed out the values in actualvalue array and it gives 1,2.
but even then the assertion fails !!!
where have i gone wrong ?
the error msg is :
junit.framework.AssertionFailedError:expected:<2>but was:<1>
at .........my pkg name
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Unknown Source)
Thanks!