Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
Changed assertions for better understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopaul authored and slu-it committed Jan 4, 2017
1 parent ee1aaa6 commit e6dca95
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package integration.pageobjects;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.core.Is.is;

import java.util.List;
Expand Down Expand Up @@ -35,62 +36,62 @@ protected String getHTMLFilePath() {
@Test
public final void testThatListWithOptionTextsIsReturnedCorrectly_singleSelect() {
List<String> texts = page.singleSelect.getAllOptionTexts();
assertThat(texts.get(0).equals("one"), is(true));
assertThat(texts.get(1).equals("two"), is(true));
assertThat(texts.get(2).equals("three"), is(true));
assertThat(texts.get(0), is("one"));
assertThat(texts.get(1), is("two"));
assertThat(texts.get(2), is("three"));
}

@Test
public final void testThatListWithOptionTextsIsReturnedCorrectly_multiSelect() {
List<String> texts = page.multiSelect.getAllOptionTexts();
assertThat(texts.get(0).equals("one"), is(true));
assertThat(texts.get(1).equals("two"), is(true));
assertThat(texts.get(2).equals("three"), is(true));
assertThat(texts.get(0), is("one"));
assertThat(texts.get(1), is("two"));
assertThat(texts.get(2), is("three"));
}

@Test
public final void testThatListWithOptionTextsIsReturnedCorrectly_emptySelect() {
List<String> optionTexts = page.emptySelect.getAllOptionTexts();
assertThat(optionTexts.isEmpty(), is(true));
assertThat(optionTexts, is(empty()));
}

/* get all option values */

@Test
public final void testThatListWithOptionValuesIsReturnedCorrectly_singleSelect() {
List<String> values = page.singleSelect.getAllOptionValues();
assertThat(values.get(0).equals("1"), is(true));
assertThat(values.get(1).equals("2"), is(true));
assertThat(values.get(2).equals("3"), is(true));
assertThat(values.get(0), is("1"));
assertThat(values.get(1), is("2"));
assertThat(values.get(2), is("3"));
}

@Test
public final void testThatListWithOptionValuesIsReturnedCorrectly_multiSelect() {
List<String> values = page.multiSelect.getAllOptionValues();
assertThat(values.get(0).equals("1"), is(true));
assertThat(values.get(1).equals("2"), is(true));
assertThat(values.get(2).equals("3"), is(true));
assertThat(values.get(0), is("1"));
assertThat(values.get(1), is("2"));
assertThat(values.get(2), is("3"));
}


@Test
public final void testThatListWithOptionValuesIsReturnedCorrectly_emptySelect() {
List<String> optionValues = page.emptySelect.getAllOptionValues();
assertThat(optionValues.isEmpty(), is(true));
assertThat(optionValues, is(empty()));
}

/* number of options */

@Test
public final void testThatCorrectNumberOfOptionsIsReturned_singelSelect() {
Integer numberOfOptions = page.singleSelect.getNumberOfOptions();
assertThat(numberOfOptions.equals(3), is(true));
assertThat(numberOfOptions, is(3));
}

@Test
public final void testThatCorrectNumberOfOptionsIsReturned_multiSelect() {
Integer numberOfOptions = page.multiSelect.getNumberOfOptions();
assertThat(numberOfOptions.equals(3), is(true));
assertThat(numberOfOptions, is(3));
}

/* validation of mapping */
Expand Down

0 comments on commit e6dca95

Please sign in to comment.