assertSame
and assertNotSame
use the ==
operator:
public void testAIsA() {
Fraction a = Fraction.getFraction(17, 56);
assertSame(a, a);
}
public void testAIsNotA2() {
Fraction a = Fraction.getFraction(17, 56);
Fraction b = Fraction.getFraction(17, 56);
assertNotSame(a, b);
}
Does the last test go too far? is that really part of the class's contract?