public void FastLookupDictionaryTryGetValueShouldContainAllValuesOfLargeList() { var fastLookupDictionary = new FastLookupDictionary<int, int>(); for (int i = 0; i < 50; i++) { fastLookupDictionary.Add(i, i); int value; Assert.IsTrue(fastLookupDictionary.TryGetValue(i, out value)); } }
public void FastLookupDictionaryTryGetValueShouldContainAllValuesOfLargeList() { var fastLookupDictionary = new FastLookupDictionary <int, int>(); for (int i = 0; i < 50; i++) { fastLookupDictionary.Add(i, i); int value; Assert.IsTrue(fastLookupDictionary.TryGetValue(i, out value)); } }
public void FastLookupDictionaryTryGetValueShouldReturnValueWithSameHashCode() { // create two elements with the same hashcode var first = new Element(1); var second = new Element(1); var fastLookupDictionary = new FastLookupDictionary<Element, Element>(); fastLookupDictionary[first] = second; Element third = null; Assert.IsTrue(fastLookupDictionary.TryGetValue(second, out third)); Assert.IsTrue(ReferenceEquals(third, second)); }
public void FastLookupDictionaryTryGetValueShouldReturnValueWithSameHashCode() { // create two elements with the same hashcode var first = new Element(1); var second = new Element(1); var fastLookupDictionary = new FastLookupDictionary <Element, Element> { [first] = second }; Assert.IsTrue(fastLookupDictionary.TryGetValue(second, out Element third)); Assert.IsTrue(ReferenceEquals(third, second)); }