Code Monkey home page Code Monkey logo

odiff's People

Contributors

goeran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

joelmheim peters

odiff's Issues

False cyclic dependency exceptions

We get false cyclic dependency exceptions (ObjectGraphDiff.cs:87).

Thrown if both left and right graph contain value type objects that hash to the same value (e.g. MongoDB.Bson.ObjectId with the same value in each graph).

Also: It is also thrown for reference types types that only contain such value types, e.g.:
public class TimeRange
{
public readonly TimeSpan Start;
public readonly TimeSpan End;
public TimeRange(string hhmmStart, string hhmmEnd)
{
//..
}
}

It would be great if it was possible to disable the cyclic dependency checking. We know that our graphs are not cyclic. :-)

Also, we think there may be a problem in ODiff.Extensions.ObjectExtensions.cs:32. Perhaps it is better to use obj is ValueType?

Implicitly Typed Array causes Cyclic Dependency Exception

I'm not sure why this happens but I thought I would report it.....

Given:

[Serializable]
public class LineItem
{
    public string Product { get; set; }
    public decimal Total { get; set; }
}

[Serializable]
public class Order
{
    public int Id { get; set; }
    public IEnumerable<LineItem> LineItems { get; set; }
}

Using the Test:

[Test]
public void It_will_compare_Implicitly_Typed_Arrays()
{
    var lineItem = new LineItem {Product = "Product A", Total = 2.00M};
    var order = new Order() {Id = 1, LineItems = new[] {lineItem}};

    var orderCopy = (Order)ObjectCloner.Clone(order);

    var report = Diff.ObjectValues(order, orderCopy);
    Assert.IsFalse(report.DiffFound);
}

Expected: Test passes with no differences found

Actual: System.Exception : It's not possible to diff graphs with cyclic dependencies. Found in: LineItems.SyncRoot

Note: If the line items were instead initialized using a List() the test passes.

var order = new Order() {Id = 1, LineItems = new List<LineItem>{lineItem}};

Support strict mode

Where it will evaluate null == null to not be an equal value.

This means it will detect graphs with null objects. Can be used to detect code that's not mapped in a data storage scenario.

License

We could not find any information about the license agreement.

It would be great if we could use the MIT license:
https://opensource.org/licenses/MIT

Can you put the license agreement in the project root? Thnx!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.