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