[FIX] Further adjusted the assertEquals in PetTests to better compare the two parameters (as pointed out by @amawai)

This commit is contained in:
Jad Malek 2018-02-24 17:11:11 -05:00
parent 36d98e5949
commit b6d3dd1c11

View file

@ -47,7 +47,7 @@ public class PetTests {
walrus.setName("Alex Garland"); walrus.setName("Alex Garland");
pet.setType(walrus); pet.setType(walrus);
PetType resultOfGetType = pet.getType(); PetType resultOfGetType = pet.getType();
assertEquals(walrus, resultOfGetType); assertEquals(walrus.getName(), resultOfGetType.getName());
} }
@Test @Test
@ -56,7 +56,7 @@ public class PetTests {
Owner amandeepBhandal = new Owner(); Owner amandeepBhandal = new Owner();
pet.setOwner(amandeepBhandal); pet.setOwner(amandeepBhandal);
Owner resultOfGetOwner = pet.getOwner(); Owner resultOfGetOwner = pet.getOwner();
assertEquals(amandeepBhandal, resultOfGetOwner); assertEquals(amandeepBhandal.getAddress(), resultOfGetOwner.getAddress());
} }
@Test @Test
@ -65,7 +65,7 @@ public class PetTests {
Set<Visit> visitsForTesting = new LinkedHashSet<>(); Set<Visit> visitsForTesting = new LinkedHashSet<>();
pet.setVisitsInternal(visitsForTesting); pet.setVisitsInternal(visitsForTesting);
Set<Visit> resultOfGetVisitsInternal = pet.getVisitsInternal(); Set<Visit> resultOfGetVisitsInternal = pet.getVisitsInternal();
assertEquals(visitsForTesting, resultOfGetVisitsInternal); assertEquals(visitsForTesting.size(), resultOfGetVisitsInternal.size());
} }
@Test @Test