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