10 implementations of Add
Microsoft.Build.Framework (1)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.Collections.Package (1)
Microsoft.CodeAnalysis.InteractiveHost (1)
Microsoft.CodeAnalysis.Threading.Package (1)
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
System.Collections.Immutable (2)
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\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));