public void SetCollectionAdapter_SymmetricExceptWith_Succeeds() { List <int> backingList = new List <int>() { 12, 13, 14, 15 }; SetCollectionAdapter <int> adapter = new SetCollectionAdapter <int>(backingList); adapter.SymmetricExceptWith(new int[] { 7, 13, 8, 12, 13 }); CollectionAssert.AreEquivalent(new int[] { 7, 8, 14, 15 }, backingList); }
public void SetCollectionAdapter_SymmetricExceptWith_Null_ThrowsArgumentNull() { List <int> backingList = new List <int>() { 12, 13, 14 }; SetCollectionAdapter <int> adapter = new SetCollectionAdapter <int>(backingList); Assert.ThrowsException <ArgumentNullException>( #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. () => adapter.SymmetricExceptWith(null)); #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. }
public void SetCollectionAdapter_SymmetricExceptWith_IsReadOnly_ThrowsNotSupported() { ICollection <int> backingList = new ReadOnlyCollection <int>(new List <int>() { 12, 13, 14 }); SetCollectionAdapter <int> adapter = new SetCollectionAdapter <int>(backingList); NotSupportedException e = Assert.ThrowsException <NotSupportedException>( () => adapter.SymmetricExceptWith(new int[] { 7, 13 })); Assert.AreEqual( ExceptionMessages.CollectionIsReadOnly, e.Message); }