Alternative to FluentAssertions
Earlier this year fluentassertion went to a paid license model. What are some assertion libraries which are similar in assertion style and features, but free?
One feature we use quite a bit is the object comparer (.BeEquivelantTo()) so whatever we swap to, should ideally support object graph comparison.
Let me hear what you guys use / think would be a good free replacement 🙂
5 Replies
I think AwesomeAssertions is the alternative, haven't used it though
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
shouldly seems popular
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
if its just that method that you want you could also just write it yourself, a method that checks if two objects are deeply equal isnt too hard I guess.
from may naive pov there are 3 cases to cover
1. primitive or string or value type is the base case, just return if they are equal
2. IEnumerable, check element one by one by calling your method recursively
3. Other, in which case you recurse into the object's props
Something like that 🤔
few edge cases that come to mind like unordered collections and cycles that you'd need to address somehow but for a naive approach that should work I think