I am writing a test for my library written in C #. And I want to check if two lists are the same if and only if they have the same elements (do not require elements in the same order). I am trying to convert a list to hashset and check if the two hashes are the same. But the result of the execution is not what I expected.
Can someone explain how the hashset method works? Does it match two objects using the getHashCode method of objects or the equals method? Thank!
IEqualityComparer < > , HashSet. , EqualityComparer < > . Default. , IEquatable < > Equals GetHashCode .
, , . IEqualityComparer .
Source: https://habr.com/ru/post/1763296/More articles:В Scala 2.8, как написать (добавить) строку в файл? Должен ли я использовать Java clesses или для этого существуют собственные функции Scala? - scalaClick a hyperlink using powershell - powershellHow can I get an NSNumber without performing a selection on it so that it responds to initWithInt? - iphoneRun batch file continuously after 20 minutes (Windows XP OS)? - windowsWorking with Xcode Breakpoints - debuggingUnable to use Performance Plugin with Hudson - maven-2Проверка ввода в текстовом поле в телефоне Windows 7 - c#PHP "parse the error, expecting` T_STRING '"- Please help with the code - phpHow to fix xml file based on xml schema? - xmlSimple threading issue using windows service - c #All Articles