@Test(expected = AssertionError.class) public void testAssertThat_node_has_no_children_fails_when_node_has_children() { final Node root = new DefaultNode(String.class); final Node child = new DefaultNode(root, mock(Accessor.class), String.class); root.addChild(child); assertThat(root).node().hasNoChildren(); }
@Test public void testAssertThat_node_has_children_succeeds_when_children_are_present() throws Exception { final Node root = new DefaultNode(String.class); final Node child = new DefaultNode(root, mock(Accessor.class), String.class); root.addChild(child); assertThat(root).node().hasChildren(); }
@Test(expected = AssertionError.class) public void testAssertThat_node_has_changed_state_fails_when_node_has_different_state() { final Node node = new DefaultNode(String.class); node.setState(Node.State.UNTOUCHED); assertThat(node).node().hasState(Node.State.CHANGED); }
@Test public void testAssertThat_node_has_changed_state_succeeds_when_node_has_changed() { final Node node = new DefaultNode(String.class); node.setState(Node.State.CHANGED); assertThat(node).node().hasState(Node.State.CHANGED); }