1 override of Empty
Microsoft.CodeAnalysis.UnitTests (1)
Collections\ImmutableSegmentedHashSetTest.cs (1)
215protected override System.Collections.Immutable.IImmutableSet<T> Empty<T>()
41 references to Empty
Microsoft.CodeAnalysis.UnitTests (41)
Collections\ImmutableSetTest.cs (32)
28AddTestHelper(this.Empty<int>(), 3, 5, 4, 3); 35AddTestHelper(this.Empty<int>(), arrayWithDuplicates); 41RemoveTestHelper(this.Empty<int>().Add(3).Add(5), 5, 3); 48AddRemoveLoadTestHelper(Empty<double>(), data); 54System.Collections.Immutable.IImmutableSet<int> emptySet = this.Empty<int>(); 76var set = this.Empty<int>().Add(5); 77var empty2 = this.Empty<int>(); 96Empty<int>().Except(Enumerable.Range(1, 1).Select(n => { enumerated = true; return n; })); 103Assert.True(this.Empty<int>().SetEquals(this.Empty<int>())); 104var nonEmptySet = this.Empty<int>().Add(5); 143Assert.False(Empty<int>().Equals(null)); 144Assert.False(Empty<int>().Equals("hi")); 145Assert.True(Empty<int>().Equals(Empty<int>())); 146Assert.False(Empty<int>().Add(3).Equals(Empty<int>().Add(3))); 147Assert.False(Empty<int>().Add(5).Equals(Empty<int>().Add(3))); 148Assert.False(Empty<int>().Add(3).Add(5).Equals(Empty<int>().Add(3))); 149Assert.False(Empty<int>().Add(3).Equals(Empty<int>().Add(3).Add(5))); 156Assert.Equal(EqualityComparer<object>.Default.GetHashCode(Empty<int>()), Empty<int>().GetHashCode()); 162var originalSet = this.Empty<int>(); 171var set = (ISet<int>)this.Empty<int>(); 182var set = (ICollection<int>)this.Empty<int>(); 192ICollection builder = (ICollection)this.Empty<string>(); 196builder = (ICollection)this.Empty<string>().Add("a"); 210var empty = this.Empty<string?>(); 254return this.Empty<T>().Union(items);
Collections\ImmutableSetTest.nonnetstandard.cs (9)
25ExceptTestHelper(Empty<int>().Add(1).Add(3).Add(5).Add(7), 3, 7); 31SymmetricExceptTestHelper(Empty<int>().Add(1).Add(3).Add(5).Add(7), Enumerable.Range(0, 9).ToArray()); 32SymmetricExceptTestHelper(Empty<int>().Add(1).Add(3).Add(5).Add(7), Enumerable.Range(0, 5).ToArray()); 38var set = this.Empty<double>(); 49IntersectTestHelper(Empty<int>().Union(Enumerable.Range(1, 10)), 8, 3, 5); 55UnionTestHelper(this.Empty<int>(), new[] { 1, 3, 5, 7 }); 56UnionTestHelper(this.Empty<int>().Union(new[] { 2, 4, 6 }), new[] { 1, 3, 5, 7 }); 57UnionTestHelper(this.Empty<int>().Union(new[] { 1, 2, 3 }), Array.Empty<int>()); 58UnionTestHelper(this.Empty<int>().Union(new[] { 2 }), Enumerable.Range(0, 1000).ToArray());