goeran / odiff Goto Github PK
View Code? Open in Web Editor NEWA super simple tool for comparing values in two object graphs
License: MIT License
A super simple tool for comparing values in two object graphs
License: MIT License
The same problem we had with properties, that I fixed today.
It's easier to use when unit testing. This should also pretty print the result.
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?
This is useful when there is a diff in a child object, and you want to grab some information form the parent objects.
This is useful when pretty printing the DiffTable.
It should be made more human readable.
Today it's optimized for a code scanner, not to be scanned by human eyes.
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}};
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.
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!
Today only ILists are supported
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.