use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method stylePrimaryNameEqualsWithAsAssertionErrorMessage.
@Test
public void stylePrimaryNameEqualsWithAsAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setStylePrimaryName("primary");
a.addStyleName("second");
// When
try {
assertThat(a).as("my anchor").stylePrimaryNameEquals("not-my-style");
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[my anchor stylePrimaryName] expected:<\"[not-my-style]\"> but was:<\"[primary]\">");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method isAttachedWithAsAndCustomAssertionErrorMessage.
@Test
public void isAttachedWithAsAndCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
// When
try {
GwtAssertions.assertThat(a).as("my anchor").overridingErrorMessage("custom failure").isAttached();
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 titleEqualsAssertionErrorMessageWithPrefix.
@Test
public void titleEqualsAssertionErrorMessageWithPrefix() {
// Given
Anchor a = new Anchor();
a.setTitle("Lost 108");
// When
try {
GwtAssertions.assertThat(a).withPrefix("my prefix").titleEquals("John Locke");
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[my prefix Anchor's title] expected:<\"[John Locke]\"> but was:<\"[Lost 108]\">");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class AnchorTest method absoluteTop.
@Test
public void absoluteTop() {
// Given
Anchor a = new Anchor();
// Then
assertThat(a.getAbsoluteTop()).isEqualTo(0);
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class AnchorTest method title.
@Test
public void title() {
// Given
Anchor a = new Anchor();
// When
a.setTitle("title");
// Then
assertThat(a.getTitle()).isEqualTo("title");
}
Aggregations