use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method titleEquals.
@Test
public void titleEquals() {
// Given
Anchor a = new Anchor();
a.setTitle("Lost 108");
// When
try {
GwtAssertions.assertThat(a).titleEquals("Lost 108");
} 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 isNotAttachedWithAsAssertionErrorMessage.
@Test
public void isNotAttachedWithAsAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
RootPanel.get().add(a);
// When
try {
GwtAssertions.assertThat(a).as("my anchor").isNotAttached();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[my anchor] should not be attached");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method styleNameEqualsWithCustomAssertionErrorMessage.
@Test
public void styleNameEqualsWithCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setStyleName("first");
a.addStyleName("second");
// When
try {
assertThat(a).overridingErrorMessage("custom error message").styleNameEquals("not-my-style");
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[Anchor's styleName] 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 isAttachedAssertionErrorMessage.
@Test
public void isAttachedAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
// When
try {
GwtAssertions.assertThat(a).isAttached();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[Anchor] should be attached");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method htmlEqualsWithCustomAssertionErrorMessage.
@Test
public void htmlEqualsWithCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setHTML("<h3>Ben Linus</h3>");
// When
try {
GwtAssertions.assertThat(a).overridingErrorMessage("custom error message").htmlEquals("John Locke");
fail("AssertionError should be thrown");
} catch (AssertionError e) {
assertThat(e.getMessage()).isEqualTo("[Anchor's HTML] custom error message");
}
}
Aggregations