forked from reposense/RepoSense
-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
43 additions
and
56 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 |
---|---|---|
|
@@ -6,6 +6,13 @@ | |
import org.junit.jupiter.api.Test; | ||
|
||
public class ReportAuthorDetailsTest { | ||
private static final ReportAuthorDetails details1 = new ReportAuthorDetails( | ||
List.of("[email protected]"), | ||
"gitHostId", | ||
"Display Name", | ||
"Git Author" | ||
); | ||
|
||
@Test | ||
public void constructor_withValidInputs_success() { | ||
List<String> emails = List.of("[email protected]", "[email protected]"); | ||
|
@@ -36,13 +43,11 @@ public void constructor_nullGitHostId_throwsIllegalArgumentException() { | |
|
||
@Test | ||
public void equals_sameObject_success() { | ||
ReportAuthorDetails details1 = new ReportAuthorDetails( | ||
List.of("[email protected]"), | ||
"gitHostId", | ||
"Display Name", | ||
"Git Author" | ||
); | ||
Assertions.assertEquals(details1, details1); | ||
} | ||
|
||
@Test | ||
public void equals_equivalentObject_success() { | ||
ReportAuthorDetails details2 = new ReportAuthorDetails( | ||
List.of("[email protected]"), | ||
"gitHostId", | ||
|
@@ -55,20 +60,13 @@ public void equals_sameObject_success() { | |
|
||
@Test | ||
public void equals_differentObject_failure() { | ||
ReportAuthorDetails details1 = new ReportAuthorDetails( | ||
List.of("[email protected]"), | ||
"gitHostId", | ||
"Display Name", | ||
"Git Author" | ||
); | ||
|
||
ReportAuthorDetails details2 = new ReportAuthorDetails( | ||
List.of("test@example.com"), | ||
List.of("test1@example.com"), | ||
"gitHostId", | ||
"Display Name", | ||
"Git Author" | ||
); | ||
|
||
Assertions.assertNotEquals(details1, details2); | ||
Assertions.assertFalse(details1.equals(details2)); | ||
} | ||
} |
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
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
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
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