8 implementations of Add
Microsoft.Build.Framework (1)
ImmutableSegmentedDictionary`2.cs (1)
322IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
Microsoft.CodeAnalysis (1)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
313IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
Microsoft.CodeAnalysis.CodeStyle (1)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
313IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
Microsoft.CodeAnalysis.Collections.Package (1)
ImmutableSegmentedDictionary`2.cs (1)
313IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
Microsoft.CodeAnalysis.Workspaces (1)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
313IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (1)
313IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
System.Collections.Immutable (2)
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
504IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
381IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
50 references to Add
Microsoft.CodeAnalysis.UnitTests (50)
Collections\ImmutableDictionaryBuilderTestBase.cs (14)
80var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5); 88var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5).Add("six", 6); 99var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5).Add("six", 6); 109var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5); 129var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5).Add("six", 6); 138var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5).Add("six", 6); 147var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5).Add("six", 6); 158var map = this.GetEmptyImmutableDictionary<string, int>().Add("five", 5).Add("six", 6);
Collections\ImmutableDictionaryBuilderTestBase.nonnetstandard.cs (1)
22.Add("a", 1).ToBuilder();
Collections\ImmutableDictionaryTestBase.cs (16)
113var map = this.Empty<int, int>().Add(3, 5); 142var dictionary = (ICollection)Empty<string, int>().Add("a", 1); 156var dictionary = (IDictionary<string, int>)Empty<string, int>().Add("c", 3); 167var dictionary = (IDictionary)Empty<string, int>().Add("c", 3); 185var dictionary = (IDictionary)Empty<string, int>().Add("a", 1); 226.Add("a", 1); 261map = map.Add(key, value1); 262Assert.True(IsSame(map, map.Add(key, value2))); 286var map1 = map.Add(key, value1); 287var map2 = map.Add(key, value2); 288Assert.Throws<ArgumentException>(null, () => map1.Add(key, value2)); 289Assert.Throws<ArgumentException>(null, () => map2.Add(key, value1)); 295Assert.True(map.Add(key, value).ContainsKey(key)); 303Assert.True(map.Add(key, value).Contains(new KeyValuePair<TKey, TValue>(key, value))); 304Assert.True(map.Add(key, value).Contains(key, value)); 315var addedMap = map.Add(key, default(TValue));
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (19)
49IDictionary<int, int> map = this.Empty<int, int>().Add(5, 3).ToReadOnlyDictionary(); 73Assert.False(Empty<int, int>().Add(3, 2).Equals(Empty<int, int>().Add(3, 2))); 74Assert.False(Empty<int, int>().Add(3, 2).Equals(Empty<int, int>().Add(3, 1))); 75Assert.False(Empty<int, int>().Add(5, 1).Equals(Empty<int, int>().Add(3, 1))); 76Assert.False(Empty<int, int>().Add(3, 1).Add(5, 1).Equals(Empty<int, int>().Add(3, 1))); 77Assert.False(Empty<int, int>().Add(3, 1).Equals(Empty<int, int>().Add(3, 1).Add(5, 1))); 82Assert.False(Empty<int, int>().Add(3, 1).ToReadOnlyDictionary().Equals(Empty<int, int>())); 83Assert.False(Empty<int, int>().Equals(Empty<int, int>().Add(3, 1).ToReadOnlyDictionary())); 84Assert.False(Empty<int, int>().ToReadOnlyDictionary().Equals(Empty<int, int>().Add(3, 1).ToReadOnlyDictionary())); 130IImmutableDictionary<TKey, TValue> addedMap = map.Add(key, value); 213var nonEmpty = map.Add(key, default(TValue)); 224var nonEmpty = map.Add(key, default(TValue));