Using XUnit I can set a precision when comparing two decimals or doubles:
decimal a = 2.7512m;
decimal b = 2.7502m;
Assert.Equal(a, b, 2);
But I need to check if two Lists of Decimals are equal:
List<Decimal> listA = new List<Decimal> { 2.7512m, 1.1234m }
List<Decimal> listB = new List<Decimal> { 2.7502m, 1.1252m }
Assert.Equal(listA, listB);
In this case Assert.Equal does not have a precision parameter just an IEqualityComparer.
How can I create an IEqualityComparer to accomplish the same?
Is there another option?