public CursorLoaderAssert hasSelectionArgs(String... selectionArgs) { isNotNull(); assertThat(actual.getSelectionArgs()).isEqualTo(selectionArgs); return this; }
public CursorLoaderAssert hasProjection(String... projection) { isNotNull(); assertThat(actual.getProjection()).isEqualTo(projection); return this; }
public CursorLoaderAssert hasSelectionArgs(String... selectionArgs) { isNotNull(); assertThat(actual.getSelectionArgs()).isEqualTo(selectionArgs); return this; }
public CursorLoaderAssert hasProjection(String... projection) { isNotNull(); assertThat(actual.getProjection()).isEqualTo(projection); return this; }
public MultiSelectListPreferenceAssert hasEntries(CharSequence... entries) { isNotNull(); CharSequence[] actualEntries = actual.getEntries(); assertThat(actualEntries) // .overridingErrorMessage("Expected entries <%s> but was <%s>.", entries, actualEntries) // .isEqualTo(entries); return this; }
public NumberPickerAssert hasDisplayedValues(String[] values) { isNotNull(); String[] actualValues = actual.getDisplayedValues(); assertThat(actualValues) // .overridingErrorMessage("Expected displayed values <%s> but was <%s>.", values, actualValues) // .isEqualTo(values); return this; }
public ListPreferenceAssert hasEntries(CharSequence... entries) { isNotNull(); CharSequence[] actualEntries = actual.getEntries(); assertThat(actualEntries) // .overridingErrorMessage("Expected entries <%s> but was <%s>.", entries, actualEntries) // .isEqualTo(entries); return this; }
public ListPreferenceAssert hasEntryValues(CharSequence... values) { isNotNull(); CharSequence[] actualValues = actual.getEntryValues(); assertThat(actualValues) // .overridingErrorMessage("Expected entry values <%s> but was <%s>.", values, actualValues) // .isEqualTo(values); return this; }
public MultiSelectListPreferenceAssert hasEntryValues(CharSequence... values) { isNotNull(); CharSequence[] actualValues = actual.getEntryValues(); assertThat(actualValues) // .overridingErrorMessage("Expected entry values <%s> but was <%s>.", values, actualValues) // .isEqualTo(values); return this; }
@Test public void testFetchAllExecutors() throws Exception { final List<Executor> executors = addTestExecutors(); executors.get(0).setActive(false); this.executorDao.updateExecutor(executors.get(0)); final List<Executor> fetchedExecutors = this.executorDao.fetchAllExecutors(); assertThat(executors.size()).isEqualTo(fetchedExecutors.size()); assertThat(executors.toArray()).isEqualTo(fetchedExecutors.toArray()); }
@Test public void widgetFromIterableWithListOfIntParam_returnedDropdownHasOptions() throws Exception { String[] resultOptions = new String[]{"1", "2", "3", "4"}; //when Dropdown dropdown = InteractiveBase.widgetFromIterable(Arrays.asList(1, 2, 3, 4)); //then Assertions.assertThat(dropdown.getOptions()).isEqualTo(resultOptions); }
@Test public void widgetFromIterableWithIntParam_returnedDropdownHasOptions() throws Exception { String[] resultOptions = new String[]{"123"}; //when Dropdown dropdown = InteractiveBase.widgetFromIterable(123); //then Assertions.assertThat(dropdown.getOptions()).isEqualTo(resultOptions); }
@Test public void widgetFromIterableWithArrayOfIntParam_returnedDropdownHasOptions() throws Exception { String[] resultOptions = new String[]{"1", "2", "3", "4"}; //when Dropdown dropdown = InteractiveBase.widgetFromIterable(new Integer[]{1, 2, 3, 4}); //then Assertions.assertThat(dropdown.getOptions()).isEqualTo(resultOptions); }
@Test public void setTooltips_hasThatTooltips() throws Exception { String[] expected = new String[]{"test1", "test2"}; //given ToggleButtons toggleButtons = toggleButtons(); //when toggleButtons.setTooltips(expected); //then Assertions.assertThat(toggleButtons.getTooltips()).isEqualTo(expected); }
@Test public void setIcons_hasThatIcons() throws Exception { String[] expected = new String[]{"icon1", "icon2"}; //given ToggleButtons toggleButtons = toggleButtons(); //when toggleButtons.setIcons(expected); //then Assertions.assertThat(toggleButtons.getIcons()).isEqualTo(expected); }
@Test public void updateValue() throws Exception { SelectMultipleSingle widget = selectMultipleSingle(); widget.setOptions(new String[]{"1", "2", "3"}); kernel.clearPublishedMessages(); //when widget.updateValue(1); //then assertThat(widget.getValue()).isEqualTo(new String[]{"2"}); }
@Test public void widgetFromIterableWithMapOfIntParam_returnedDropdownHasOptions() throws Exception { String[] resultOptions = new String[]{"1", "2", "3", "4"}; Map map = new HashMap<Integer, Integer>(){ { put(1, 1); put(2, 2); put(3, 3); put(4, 4);} }; //when Dropdown dropdown = InteractiveBase.widgetFromIterable(map); //then Assertions.assertThat(dropdown.getOptions()).isEqualTo(resultOptions); }
@Test public void testCrossProductIterableShouldReturnEmptyWhenRightSideIsEmpty() { // Given: // When: @SuppressWarnings("unchecked") Object[][] result = crossProduct(Collections.<Iterable<Object>>emptyList(), asList(asList(1), asList(2), asList(3))); // Then: assertThat(result).isEqualTo(new Object[][] {}); }
@Test public void testCrossProductSingleArgObjectArrayShouldReturnEmptyWhenRightSideIsEmpty() { // Given: // When: Object[][] result = crossProductSingleArg(new Object[0], new Object[] { 1, 2, 3 }); // Then: assertThat(result).isEqualTo(new Object[][] {}); }
@Test public void testProjectionQuery() { LuceneQueryParsingResult<Class<?>> parsingResult = parseAndTransform("select e.id, e.name from org.infinispan.query.dsl.embedded.impl.model.Employee e"); assertThat(parsingResult.getQuery().toString()).isEqualTo("*:*"); assertThat(parsingResult.getProjections()).isEqualTo(new String[]{"id", "name"}); }