public void BeEqualBySimilarity( string productId1, decimal price1, uint amount1, string productId2, decimal price2, uint amount2, bool expected) { var sut = new InvoiceItem(productId1, price1, amount1); var other = new InvoiceItem(productId2, price2, amount2); Assert.Equal(expected, sut.Equals(other)); Assert.Equal(expected, sut.Equals((object)other)); Assert.Equal(expected, sut == other); Assert.Equal(expected, !(sut != other)); Assert.Equal(expected, sut.GetHashCode() == other.GetHashCode()); }