I have a dictionary.
Dictionary<YMD, object> cache = new Dictionary<YMD, object>();
The YMD class is one of my inventions; it is a class containing only year, month, and date. The goal is to have the data indexed by day. In any case, I implemented the functions Equals () and CompareTo (), as well as the operators == and! =.
Despite this, the Dictionary.ContainsKey () function always returns false, even if the key exists.
I immediately thought that my comparison functions should be broken, but after writing unit tests for all of them, this is not so.
Is there anything about a vocabulary class that I don't know?
source share