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
Alex Eng
committed
Feb 6, 2018
1 parent
951b72f
commit 0806dcd
Showing
5 changed files
with
365 additions
and
13 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
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
67 changes: 67 additions & 0 deletions
67
server/services/src/test/java/org/zanata/rest/editor/dto/ReviewDataTest.java
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package org.zanata.rest.editor.dto; | ||
|
||
import org.junit.Test; | ||
import org.zanata.common.ContentState; | ||
|
||
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; | ||
|
||
/** | ||
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a> | ||
**/ | ||
public class ReviewDataTest { | ||
|
||
@Test | ||
public void transUnitIdTest() { | ||
Long id = 10L; | ||
ReviewData data = new ReviewData(); | ||
data.setTransUnitId(id); | ||
assertThat(data.getTransUnitId()).isEqualTo(id); | ||
} | ||
|
||
@Test | ||
public void revisionTest() { | ||
int revision = 10; | ||
ReviewData data = new ReviewData(); | ||
data.setRevision(revision); | ||
assertThat(data.getRevision()).isEqualTo(revision); | ||
} | ||
|
||
@Test | ||
public void commentTest() { | ||
String comment = "comment"; | ||
ReviewData data = new ReviewData(); | ||
data.setComment(comment); | ||
assertThat(data.getComment()).isEqualTo(comment); | ||
} | ||
|
||
@Test | ||
public void criteriaIdTest() { | ||
Long id = 10L; | ||
ReviewData data = new ReviewData(); | ||
data.setReviewCriteriaId(id); | ||
assertThat(data.getReviewCriteriaId()).isEqualTo(id); | ||
} | ||
|
||
@Test | ||
public void statusTest() { | ||
ContentState status = ContentState.Approved; | ||
ReviewData data = new ReviewData(); | ||
data.setStatus(status); | ||
assertThat(data.getStatus()).isEqualTo(status); | ||
} | ||
|
||
@Test | ||
public void equalTest() { | ||
ContentState status = ContentState.Approved; | ||
ReviewData data = new ReviewData(); | ||
data.setStatus(status); | ||
data.setReviewCriteriaId(1L); | ||
|
||
ReviewData data2 = new ReviewData(); | ||
data2.setStatus(status); | ||
data2.setReviewCriteriaId(1L); | ||
|
||
assertThat(data).isEqualTo(data2); | ||
assertThat(data.hashCode()).isEqualTo(data2.hashCode()); | ||
} | ||
} |
Oops, something went wrong.