コード例 #1
0
 @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();
 }
コード例 #2
0
 @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();
 }
コード例 #3
0
 @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);
 }
コード例 #4
0
 @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);
 }