-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
72 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,87 +140,85 @@ public static void setup() { | |
@Test | ||
public void HashCode_ShouldBuildHashCodeOfArgumentsForOrganizationEntity_WhenArgumentsPassed() { | ||
|
||
OrganizationEntity organizationEntity = new OrganizationEntity(); | ||
|
||
organizationEntity.setId(id); | ||
organizationEntity.setName(name); | ||
organizationEntity.setEmail(email); | ||
organizationEntity.setLogin(login); | ||
organizationEntity.setDescription(description); | ||
organizationEntity.setAvatarKey(avatarKey); | ||
organizationEntity.setWebsiteUrl(websiteUrl); | ||
organizationEntity.setChallengeCount(challengeCount); | ||
organizationEntity.setCreatedAt(createdAt); | ||
organizationEntity.setUpdatedAt(updatedAt); | ||
organizationEntity.setAcronym(acronym); | ||
|
||
OrganizationEntity organizationEntity2 = new OrganizationEntity(); | ||
organizationEntity2.setId(id); | ||
organizationEntity2.setName(name); | ||
organizationEntity2.setEmail(email); | ||
organizationEntity2.setLogin(login); | ||
organizationEntity2.setDescription(description); | ||
organizationEntity2.setAvatarKey(avatarKey); | ||
organizationEntity2.setWebsiteUrl(websiteUrl); | ||
organizationEntity2.setChallengeCount(challengeCount); | ||
organizationEntity2.setCreatedAt(createdAt); | ||
organizationEntity2.setUpdatedAt(updatedAt); | ||
organizationEntity2.setAcronym(acronym); | ||
|
||
int hashCode1 = organizationEntity.hashCode(); | ||
int hashCode2 = organizationEntity2.hashCode(); | ||
OrganizationEntity entity = new OrganizationEntity(); | ||
|
||
entity.setId(id); | ||
entity.setName(name); | ||
entity.setEmail(email); | ||
entity.setLogin(login); | ||
entity.setDescription(description); | ||
entity.setAvatarKey(avatarKey); | ||
entity.setWebsiteUrl(websiteUrl); | ||
entity.setChallengeCount(challengeCount); | ||
entity.setCreatedAt(createdAt); | ||
entity.setUpdatedAt(updatedAt); | ||
entity.setAcronym(acronym); | ||
|
||
OrganizationEntity entity2 = new OrganizationEntity(); | ||
entity2.setId(id); | ||
entity2.setName(name); | ||
entity2.setEmail(email); | ||
entity2.setLogin(login); | ||
entity2.setDescription(description); | ||
entity2.setAvatarKey(avatarKey); | ||
entity2.setWebsiteUrl(websiteUrl); | ||
entity2.setChallengeCount(challengeCount); | ||
entity2.setCreatedAt(createdAt); | ||
entity2.setUpdatedAt(updatedAt); | ||
entity2.setAcronym(acronym); | ||
|
||
int hashCode1 = entity.hashCode(); | ||
int hashCode2 = entity2.hashCode(); | ||
|
||
Assertions.assertEquals(hashCode1, hashCode2); | ||
} | ||
|
||
@Test | ||
public void EqualsObject_ShouldReturnBoolean_WhenPassedTwoObjects() { | ||
|
||
// OffsetDateTime createdAt = OffsetDateTime.now(); | ||
// OffsetDateTime updatedAt = OffsetDateTime.now(); | ||
|
||
OrganizationEntity organizationEntity = new OrganizationEntity(); | ||
organizationEntity.setId(id); | ||
organizationEntity.setName(name); | ||
organizationEntity.setEmail(email); | ||
organizationEntity.setLogin(login); | ||
organizationEntity.setDescription(description); | ||
organizationEntity.setAvatarKey(avatarKey); | ||
organizationEntity.setWebsiteUrl(websiteUrl); | ||
organizationEntity.setChallengeCount(challengeCount); | ||
organizationEntity.setCreatedAt(createdAt); | ||
organizationEntity.setUpdatedAt(updatedAt); | ||
organizationEntity.setAcronym(acronym); | ||
|
||
OrganizationEntity organizationEntity2 = new OrganizationEntity(); | ||
organizationEntity2.setId(id); | ||
organizationEntity2.setName(name); | ||
organizationEntity2.setEmail(email); | ||
organizationEntity2.setLogin(login); | ||
organizationEntity2.setDescription(description); | ||
organizationEntity2.setAvatarKey(avatarKey); | ||
organizationEntity2.setWebsiteUrl(websiteUrl); | ||
organizationEntity2.setChallengeCount(challengeCount); | ||
organizationEntity2.setCreatedAt(createdAt); | ||
organizationEntity2.setUpdatedAt(updatedAt); | ||
organizationEntity2.setAcronym(acronym); | ||
|
||
OrganizationEntity organizationEntity3 = new OrganizationEntity(); | ||
organizationEntity3.setId(2L); | ||
organizationEntity3.setName("Another Organization"); | ||
organizationEntity3.setEmail("[email protected]"); | ||
organizationEntity3.setLogin("anotherorg"); | ||
organizationEntity3.setDescription("Another description"); | ||
organizationEntity3.setAvatarKey("anotherAvatarKey"); | ||
organizationEntity3.setWebsiteUrl("https://another-example.com"); | ||
organizationEntity3.setChallengeCount(10); | ||
organizationEntity3.setCreatedAt(createdAt); | ||
organizationEntity3.setUpdatedAt(updatedAt); | ||
organizationEntity3.setAcronym("AO"); | ||
|
||
boolean equals1 = organizationEntity.equals(organizationEntity2); | ||
boolean equals2 = organizationEntity2.equals(organizationEntity); | ||
boolean equals3 = organizationEntity.equals(organizationEntity3); | ||
OrganizationEntity entity = new OrganizationEntity(); | ||
|
||
entity.setId(id); | ||
entity.setName(name); | ||
entity.setEmail(email); | ||
entity.setLogin(login); | ||
entity.setDescription(description); | ||
entity.setAvatarKey(avatarKey); | ||
entity.setWebsiteUrl(websiteUrl); | ||
entity.setChallengeCount(challengeCount); | ||
entity.setCreatedAt(createdAt); | ||
entity.setUpdatedAt(updatedAt); | ||
entity.setAcronym(acronym); | ||
|
||
OrganizationEntity entity2 = new OrganizationEntity(); | ||
entity2.setId(id); | ||
entity2.setName(name); | ||
entity2.setEmail(email); | ||
entity2.setLogin(login); | ||
entity2.setDescription(description); | ||
entity2.setAvatarKey(avatarKey); | ||
entity2.setWebsiteUrl(websiteUrl); | ||
entity2.setChallengeCount(challengeCount); | ||
entity2.setCreatedAt(createdAt); | ||
entity2.setUpdatedAt(updatedAt); | ||
entity2.setAcronym(acronym); | ||
|
||
OrganizationEntity entity3 = new OrganizationEntity(); | ||
entity3.setId(2L); | ||
entity3.setName("Another Organization"); | ||
entity3.setEmail("[email protected]"); | ||
entity3.setLogin("anotherorg"); | ||
entity3.setDescription("Another description"); | ||
entity3.setAvatarKey("anotherAvatarKey"); | ||
entity3.setWebsiteUrl("https://another-example.com"); | ||
entity3.setChallengeCount(10); | ||
entity3.setCreatedAt(createdAt); | ||
entity3.setUpdatedAt(updatedAt); | ||
entity3.setAcronym("AO"); | ||
|
||
boolean equals1 = entity.equals(entity2); | ||
boolean equals2 = entity2.equals(entity); | ||
boolean equals3 = entity.equals(entity3); | ||
|
||
Assertions.assertTrue(equals1); | ||
Assertions.assertTrue(equals2); | ||
|