exception comparing two string arrays
See original GitHub issueTrying to compare two string arrays ignoring collection order when the second one starts with a null value.
var compareLogic = new CompareLogic();
compareLogic.Config.IgnoreCollectionOrder = true;
ComparisonResult result = compareLogic.Compare(new[] {"a", "b"}, new[] {null, "a"});
throws
Unhandled exception. System.Exception: Invalid CollectionMatchingSpec. No such property (null) for type String
at KellermanSoftware.CompareNetObjects.IgnoreOrderTypes.IgnoreOrderLogic.GetMatchIndex(ComparisonResult result, List`1 spec, Object currentObject)
at KellermanSoftware.CompareNetObjects.IgnoreOrderTypes.IgnoreOrderLogic.CompareOutOfOrder(CompareParms parms, Boolean reverseCompare)
at KellermanSoftware.CompareNetObjects.IgnoreOrderTypes.IgnoreOrderLogic.CompareEnumeratorIgnoreOrder(CompareParms parms, Boolean countsDifferent)
at KellermanSoftware.CompareNetObjects.TypeComparers.ListComparer.CompareType(CompareParms parms)
at KellermanSoftware.CompareNetObjects.RootComparer.Compare(CompareParms parms)
at KellermanSoftware.CompareNetObjects.CompareLogic.Compare(Object expectedObject, Object actualObject)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
C# compare two string arrays
A very simple approach is with Any from Linq. It is only checking if any part of a line in B is contained...
Read more >Compare two string arrays for equality in Java
The two string arrays are considered equal if both arrays have the same length and contain the same elements in the same order....
Read more >Compare Two Arrays in Java
A simple way is to run a loop and compare elements one by one. Java provides a direct method Arrays.equals() to compare two...
Read more >Check If Two String Arrays are Equivalent (C++, Python & ...
Learn how to check if two string arrays are equivalent or not by using string comparison and the optimal approach in Java, Python,...
Read more >How to compare two Arrays in Java to check if they are equal
Hello guys, one of the common Programming, the day-to-date task is to compare two arrays in Java and see if they are equal...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Merged
Hi, Is this totally fixed ? Because I cannot see the update into the master trunk.
Regards.