public void TestSubsets() { SetList<int> lista = new SetList<int>(new int[] { 5, 10, 20 }); SetList<int> listb = new SetList<int>(new int[] { 2, 4, 6, 8, 10 }); SetList<int>subt = lista.SubtractSet(listb); Assert.IsFalse(subt.IsEqualTo(lista)); Assert.IsTrue(subt.Contains(5)); Assert.IsFalse(subt.Contains(10)); Assert.IsTrue(subt.IsEqualTo(new SetList<int>(new int[] { 5, 20 }))); Assert.IsTrue(subt.IsSubsetOf(lista)); Assert.IsFalse(subt.IsSupersetOf(lista)); Assert.IsTrue(lista.IsSupersetOf(subt)); Assert.IsFalse(lista.IsSubsetOf(subt)); SetList<int> copy = lista.Clone(); copy.RemoveAll(listb); Assert.IsFalse(copy.IsEqualTo(lista)); Assert.IsTrue(copy.IsEqualTo(subt)); copy.Add(11); Assert.IsFalse(copy.IsEqualTo(lista)); SetList<int> xor = lista.ExclusiveOrWith(listb); Assert.IsTrue(xor.IsEqualTo(new SetList<int>(new int[] { 2, 4, 6, 8, 5, 20 }))); SetList<int> comp = lista.ComplementOf(listb); Assert.IsTrue(comp.IsEqualTo(new SetList<int>(new int[] { 2, 4, 6, 8 }))); }