1 override of Empty
Microsoft.CodeAnalysis.UnitTests (1)
Collections\ImmutableSegmentedDictionaryTest.cs (1)
329
protected override IImmutableDictionary<TKey, TValue>
Empty
<TKey, TValue>()
54 references to Empty
Microsoft.CodeAnalysis.UnitTests (54)
Collections\ImmutableDictionaryTestBase.cs (16)
25
this.EmptyTestHelper(
Empty
<int, bool>(), 5);
31
ContainsTestHelper(
Empty
<int, string>(), 5, "foo");
37
RemoveTestHelper(
Empty
<int, GenericParameterHelper?>(), 5);
43
var map = this.
Empty
<string, int>()
65
var map = this.
Empty
<string, int>().SetItems(template);
89
map = this.
Empty
<string, int>().SetItems(new[] { // use an array for code coverage
101
ContainsKeyTestHelper(
Empty
<int, GenericParameterHelper>(), 1, new GenericParameterHelper());
107
Assert.Throws<KeyNotFoundException>(() => this.
Empty
<int, int>()[3]);
113
var map = this.
Empty
<int, int>().Add(3, 5);
123
var dictionary =
Empty
<string, int>();
130
var dictionary = (ICollection<KeyValuePair<string, int>>)
Empty
<string, int>();
140
((ICollection)
Empty
<string, int>()).CopyTo(Array.Empty<object>(), 0);
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);
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (38)
25
EnumeratorTestHelper(this.
Empty
<int, GenericParameterHelper>());
31
KeysTestHelper(
Empty
<int, bool>(), 5);
37
ValuesTestHelper(
Empty
<int, bool>(), 5);
43
AddAscendingTestHelper(
Empty
<int, GenericParameterHelper>());
49
IDictionary<int, int> map = this.
Empty
<int, int>().Add(5, 3).ToReadOnlyDictionary();
56
IDictionary<int, int> map = this.
Empty
<int, int>().ToReadOnlyDictionary();
63
IDictionary<int, int> map = this.
Empty
<int, int>().ToReadOnlyDictionary();
70
Assert.False(
Empty
<int, int>().Equals(null));
71
Assert.False(
Empty
<int, int>().Equals("hi"));
72
Assert.True(
Empty
<int, int>().Equals(
Empty
<int, int>()));
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)));
79
Assert.True(
Empty
<int, int>().ToReadOnlyDictionary().Equals(
Empty
<int, int>()));
80
Assert.True(
Empty
<int, int>().Equals(
Empty
<int, int>().ToReadOnlyDictionary()));
81
Assert.True(
Empty
<int, int>().ToReadOnlyDictionary().Equals(
Empty
<int, int>().ToReadOnlyDictionary()));
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()));
90
var map =
Empty
<int, GenericParameterHelper>();
96
var map2 =
Empty
<int, GenericParameterHelper>();
110
AddDescendingTestHelper(
Empty
<int, GenericParameterHelper>());
116
AddRemoveRandomDataTestHelper(
Empty
<double, GenericParameterHelper>());
122
AddRemoveEnumerableTestHelper(
Empty
<int, int>());