mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
Bugfixes with != instead of equals and default toString calls
This commit is contained in:
parent
752392fc46
commit
a15220d51e
74 changed files with 187 additions and 147 deletions
|
|
@ -10,6 +10,8 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Custom unit tests for {link Mana}.
|
||||
*
|
||||
|
|
@ -525,7 +527,7 @@ public class ManaTest {
|
|||
|
||||
// then
|
||||
assertEquals(mana, copy); // are equal
|
||||
assertFalse(mana == copy); // are not the same object
|
||||
assertFalse(Objects.equals(mana, copy)); // are not the same object
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -603,7 +605,7 @@ public class ManaTest {
|
|||
|
||||
// then
|
||||
assertEquals(mana, newMana);
|
||||
assertFalse(mana == newMana);
|
||||
assertFalse(Objects.equals(mana, newMana));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import static org.junit.Assert.*;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Custom unit tests for {@link Counter}
|
||||
*/
|
||||
|
|
@ -58,7 +60,7 @@ public class CounterTest {
|
|||
|
||||
// then
|
||||
assertEquals(copy, counter);
|
||||
assertFalse(copy == counter);
|
||||
assertFalse(Objects.equals(copy, counter));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue