FluentWebElement fwe = fwd.div();
assertThat(fwe, notNullValue());
when(we.getLocation()).thenReturn(new Point(1, 1));
TestableValue<Point> location = fwe.getLocation();
TestableValue<Point> pointShouldOrShouldNotBeMatchable = location.shouldBe(new Point(1, 1));
Point locn = pointShouldOrShouldNotBeMatchable.value();
assertThat(locn.toString(), equalTo("(1, 1)"));
when(we.getLocation()).thenReturn(new Point(1, 1));
try {
fwe.getLocation().shouldBe(new Point(2, 2)).value();
fail("should have barfed");
} catch (FluentExecutionStopped e) {
assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.div().getLocation().shouldBe('(2, 2)')"));
assertThat(e.getCause().getMessage().replace("(after 1 ms)", ""), equalTo("\nExpected: <(2, 2)>\n but: was <(1, 1)>"));
}
when(we.getLocation()).thenReturn(new Point(1, 1));
locn = fwe.getLocation().shouldNotBe(new Point(2, 2)).value();
assertThat(locn.toString(), equalTo("(1, 1)"));
when(we.getLocation()).thenReturn(new Point(1, 1));
try {
fwe.getLocation().shouldNotBe(new Point(1, 1)).value();
fail("should have barfed");
} catch (FluentExecutionStopped e) {
assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.div().getLocation().shouldNotBe('(1, 1)')"));
assertThat(e.getCause().getMessage().replace("(after 1 ms)", ""), equalTo("\nExpected: not <(1, 1)>\n but: was <(1, 1)>"));
}