public void SetNonDependentKey() { var dictionary = new DependentDictionary <int, string>(keys, i => i.ToString(), allowOther: true); dictionary[6] = "test"; Assert.That(dictionary[6], Is.EqualTo("test")); }
public void CountIncludesNonDependentValues() { var dictionary = new DependentDictionary <int, string>(keys, i => i.ToString(), allowOther: true); dictionary[6] = "test"; Assert.That(dictionary.Count, Is.EqualTo(6)); }
public void Setup() { keys = new List <int> { 1, 2, 3, 4, 5 }; dictionary = new DependentDictionary <int, string>(keys, i => i.ToString()); }
public void DoesntRegenerateValues() { var dictionary = new DependentDictionary <int, object>(Enumerable.Range(1, 1), x => new object()); var value1 = dictionary[1]; var value2 = dictionary[1]; Assert.That(value1, Is.EqualTo(value2)); }