39 references to Add
Microsoft.CodeAnalysis (3)
ImmutableSegmentedDictionary`2.cs (1)
323
=>
Add
(key, value);
RoslynImmutableInterlocked.cs (2)
442
var updatedCollection = priorCollection.
Add
(key, value);
544
var updatedCollection = priorCollection.
Add
(key, value);
Microsoft.CodeAnalysis.CSharp (1)
Symbols\NamedTypeSymbol.cs (1)
29
private static readonly ImmutableSegmentedDictionary<string, Symbol> RequiredMembersErrorSentinel = ImmutableSegmentedDictionary<string, Symbol>.Empty.
Add
("<error sentinel>", null!);
Microsoft.CodeAnalysis.UnitTests (35)
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (13)
57
var set = ImmutableSegmentedDictionary<int, string>.Empty.
Add
(1, "1");
126
var collection = ImmutableSegmentedDictionary<int, string?>.Empty.
Add
(1, null);
172
var map = ImmutableSegmentedDictionary.Create<string, int>().
Add
("five", 5);
182
.
Add
("a", "1").
Add
("B", "1").ToBuilder();
206
.
Add
("a", "1").
Add
("A", "1").ToBuilder();
218
.
Add
("a", "1").
Add
("A", "2").
Add
("b", "3").ToBuilder();
226
.
Add
("a", "1").
Add
("B", "1").ToBuilder();
238
var populated = ImmutableSegmentedDictionary.Create<string, int>().
Add
("a", 5).ToBuilder();
Collections\ImmutableSegmentedDictionaryTest.cs (22)
40
.
Add
("Johnny", "Appleseed")
41
.
Add
("JOHNNY", "Appleseed");
55
.
Add
("Johnny", "Appleseed")
56
.
Add
("JOHNNY", "Appleseed");
173
var map = ImmutableSegmentedDictionary.Create<string, string>().
Add
("a", "1").
Add
("B", "1");
191
.
Add
("a", "1").
Add
("A", "1");
200
.
Add
("a", "1").
Add
("A", "2").
Add
("b", "3");
208
.
Add
("firstKey", "1").
Add
("secondKey", "2");
209
var exception = Assert.Throws<ArgumentException>(null, () => map.
Add
("firstKey", "3"));
226
IImmutableDictionary<string, int> populated = ImmutableSegmentedDictionary.Create<string, int>().
Add
("a", 5);
237
var populated = ImmutableSegmentedDictionary.Create<string, int>().
Add
("a", 5);
248
ImmutableSegmentedDictionary<string, int> dict = ImmutableSegmentedDictionary.Create<string, int>().
Add
("One", 1).
Add
("Two", 2);
289
clearedDictionary = clearedDictionary.
Add
("a", 1);
297
.
Add
("a", "1").
Add
("b", "2");
322
Assert.True(map.
Add
(key, value).ContainsValue(value));