Skip to content

Commit

Permalink
NF: make TagsListTest more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed May 4, 2021
1 parent 70e4960 commit dfeabe6
Showing 1 changed file with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ public void setUp() throws Exception {

@Test
public void test_constructor_will_remove_dups() {
List<String> allTags = Arrays.asList("a", "b", "a");
List<String> checkedTags = Arrays.asList("b", "b", "b");
TagsList list = new TagsList(
Arrays.asList("a", "b", "a"),
Arrays.asList("b", "b", "b")
allTags,
checkedTags
);

assertEquals("All tags list should not contain any duplicates",
Expand All @@ -149,10 +151,13 @@ public void test_constructor_will_remove_dups() {

@Test
public void test_constructor_will_remove_dups_unchecked() {
List<String> allTags = Arrays.asList("a", "b", "a", "c", "c", "d");
List<String> checkedTags = Arrays.asList("b", "b", "b");
List<String> uncheckedTags = Arrays.asList("c", "c", "d");
TagsList list = new TagsList(
Arrays.asList("a", "b", "a", "c", "c", "d"),
Arrays.asList("b", "b", "b"),
Arrays.asList("c", "c", "d")
allTags,
checkedTags,
uncheckedTags
);

assertEquals("All tags list should not contain any duplicates",
Expand All @@ -166,9 +171,11 @@ public void test_constructor_will_remove_dups_unchecked() {

@Test
public void test_constructor_will_ignore_casing() {
List<String> allTags = Arrays.asList("aA", "bb", "aa");
List<String> checkedTags = Arrays.asList("bb", "Bb", "bB");
TagsList list = new TagsList(
Arrays.asList("aA", "bb", "aa"),
Arrays.asList("bb", "Bb", "bB")
allTags,
checkedTags
);

assertEquals("All tags list should not contain any duplicates (case insensitive)",
Expand All @@ -179,10 +186,13 @@ public void test_constructor_will_ignore_casing() {

@Test
public void test_constructor_will_ignore_casing_unchecked() {
List<String> allTags = Arrays.asList("aA", "bb", "aa", "cc", "dd");
List<String> checkedTags = Arrays.asList("bb", "Bb", "bB", "dd", "ff");
List<String> uncheckedTags = Arrays.asList("BB", "cC", "cC", "dD", "CC");
TagsList list = new TagsList(
Arrays.asList("aA", "bb", "aa", "cc", "dd"),
Arrays.asList("bb", "Bb", "bB", "dd", "ff"),
Arrays.asList("BB", "cC", "cC", "dD", "CC")
allTags,
checkedTags,
uncheckedTags
);

assertEquals("All tags list should not contain any duplicates (case insensitive)",
Expand All @@ -196,9 +206,11 @@ public void test_constructor_will_ignore_casing_unchecked() {

@Test
public void test_constructor_will_add_checked_to_all() {
List<String> allTags = Arrays.asList("aA", "bb", "aa");
List<String> checkedTags = Arrays.asList("bb", "Bb", "bB", "cc");
TagsList list = new TagsList(
Arrays.asList("aA", "bb", "aa"),
Arrays.asList("bb", "Bb", "bB", "cc")
allTags,
checkedTags
);

assertEquals("Extra tags in checked not found in all tags, must be added to all tags list",
Expand All @@ -210,10 +222,13 @@ public void test_constructor_will_add_checked_to_all() {

@Test
public void test_constructor_will_add_checked_and_unchecked_to_all() {
List<String> allTags = Arrays.asList("aA", "bb", "aa");
List<String> checkedTags = Arrays.asList("bb", "Bb", "bB", "Cc", "zz");
List<String> uncheckedTags = Arrays.asList("BB", "cC", "cC", "dD", "CC");
TagsList list = new TagsList(
Arrays.asList("aA", "bb", "aa"),
Arrays.asList("bb", "Bb", "bB", "Cc", "zz"),
Arrays.asList("BB", "cC", "cC", "dD", "CC")
allTags,
checkedTags,
uncheckedTags
);

assertEquals("Extra tags in checked not found in all tags, must be added to all tags list",
Expand Down

0 comments on commit dfeabe6

Please sign in to comment.