use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method isNotVisibleWithCustomAssertionErrorMessage.
@Test
public void isNotVisibleWithCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
// When
try {
GwtAssertions.assertThat(a).overridingErrorMessage("custom failure").isNotVisible();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[Anchor] custom failure");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method textEquals.
@Test
public void textEquals() {
// Given
Anchor a = new Anchor();
a.setText("Ben Linus");
// When
try {
GwtAssertions.assertThat(a).textEquals("Ben Linus");
} catch (AssertionError e) {
fail("assertion should pass but failed with message : " + e.getMessage());
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method textEqualsWithCustomAssertionErrorMessage.
@Test
public void textEqualsWithCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setText("Ben Linus");
// When
try {
GwtAssertions.assertThat(a).overridingErrorMessage("custom error message").textEquals("John Locke");
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[Anchor's text] custom error message");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method isVisibleWithAsAndCustomAssertionErrorMessage.
@Test
public void isVisibleWithAsAndCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setVisible(false);
// When
try {
GwtAssertions.assertThat(a).as("my anchor").overridingErrorMessage("custom failure").isVisible();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[my anchor] custom failure");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method isVisibleWithCustomAssertionErrorMessage.
@Test
public void isVisibleWithCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setVisible(false);
// When
try {
GwtAssertions.assertThat(a).overridingErrorMessage("custom failure").isVisible();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[Anchor] custom failure");
}
}
Aggregations