17 references to IsSame
Microsoft.CodeAnalysis.UnitTests (17)
Collections\ImmutableSegmentedHashSetBuilderTest.cs (3)
105
Assert.True(
IsSame
(collection, builder.ToImmutable())); // no changes at all.
109
Assert.False(
IsSame
(collection, newImmutable)); // first ToImmutable with changes should be a new instance.
110
Assert.True(
IsSame
(newImmutable, builder.ToImmutable())); // second ToImmutable without changes should be the same instance.
Collections\ImmutableSegmentedHashSetTest.cs (2)
162
Assert.True(
IsSame
(set, set.Remove(2)));
177
Assert.True(
IsSame
(set, set.Remove("c")));
Collections\ImmutableSegmentedHashSetTest.nonnetstandard.cs (3)
45
Assert.True(
IsSame
(emptySet, emptySet.ToImmutableSegmentedHashSet(comparer)));
50
Assert.True(
IsSame
(emptySet, ImmutableSegmentedHashSet<T>.Empty));
54
Assert.True(
IsSame
(reemptied, reemptied.ToImmutableSegmentedHashSet(comparer))); //, "Getting the empty set from a non-empty instance did not preserve the comparer.");
Collections\ImmutableSetTest.cs (9)
55
Assert.True(
IsSame
(emptySet, emptySet.Remove(5)));
69
Assert.True(
IsSame
(set, setAfterRemoval));
78
Assert.True(
IsSame
(set, empty2.Union(set))); // "Filling an empty immutable set with the contents of another immutable set with the exact same comparer should return the other set."
165
Assert.True(
IsSame
(originalSet, clearedSet));
291
Assert.True(
IsSame
(emptySet, emptySet.Clear()));
392
Assert.True(
IsSame
(set, set.Except(Enumerable.Empty<T>())));
403
Assert.True(
IsSame
(nextSet, nextSet.Remove(value))); //, "Removing a non-existing element should not change the set reference.");
488
Assert.True(
IsSame
(set, set.Union(Enumerable.Empty<T>())));
521
Assert.True(
IsSame
(nextSet, nextSet.Add(value))); //, "Adding duplicate value {0} should keep the original reference.", value);