Package de.danielbechler.diff.mock

Examples of de.danielbechler.diff.mock.ObjectWithHashCodeAndEquals


  }

  @Test(enabled = false, description = "Currently this is simply not possible because of the way, the CollectionItemAccessor works. Would be great, to support this.")
  public void testCompareWithListContainingObjectTwiceDetectsIfOneGetsRemoved() throws Exception
  {
    final List<ObjectWithHashCodeAndEquals> base = asList(new ObjectWithHashCodeAndEquals("foo"), new ObjectWithHashCodeAndEquals("foo"));
    final List<ObjectWithHashCodeAndEquals> working = asList(new ObjectWithHashCodeAndEquals("foo"));
    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);
    node.visit(new NodeHierarchyVisitor());
    assertThat(node)
        .child(NodePath.startBuilding()
            .collectionItem(new ObjectWithHashCodeAndEquals("foo"))
            .build())
        .hasState(DiffNode.State.REMOVED);
  }
View Full Code Here


  }

  @Test(enabled = false, description = "Currently this is simply not possible because of the way, the CollectionItemAccessor works. Would be great, to support this.")
  public void testCompareWithListContainingObjectOnceDetectsIfAnotherInstanceOfItGetsAdded() throws Exception
  {
    final List<ObjectWithHashCodeAndEquals> base = asList(new ObjectWithHashCodeAndEquals("foo"));
    final List<ObjectWithHashCodeAndEquals> working = asList(new ObjectWithHashCodeAndEquals("foo"), new ObjectWithHashCodeAndEquals("foo"));
    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);
    node.visit(new NodeHierarchyVisitor());
    assertThat(node).child(NodePath.startBuilding()
        .collectionItem(new ObjectWithHashCodeAndEquals("foo"))
        .build()).hasState(DiffNode.State.ADDED);
  }
View Full Code Here

TOP

Related Classes of de.danielbechler.diff.mock.ObjectWithHashCodeAndEquals

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.