public void set_has_correct_content_after_adding_set(IntSet set, IntSet other)
        {
            MutableIntSet editedSet = set.EditCopy();

            editedSet.AddAll(other);
            Assert.IsTrue(editedSet.IsSupersetOf(other));
            Assert.IsTrue(set.Union(other).SetEquals(editedSet));
            IntSet result = editedSet.CompleteAndDestroy();

            Assert.IsTrue(result.IsSupersetOf(other));
            Assert.IsTrue(set.Union(other).SetEquals(result));
        }
Exemple #2
0
        public void addall_with_set_of_different_size(IntSet set)
        {
            var otherSetType = new BitSetType(10);
            var other        = otherSetType.Of(2, 5, 9);

            MutableIntSet editedSet = set.EditCopy();

            editedSet.AddAll(other);
            Assert.IsTrue(editedSet.IsSupersetOf(other));
            Assert.IsTrue(set.Union(other).SetEquals(editedSet));
            IntSet result = editedSet.CompleteAndDestroy();

            Assert.IsTrue(result.IsSupersetOf(other));
            Assert.IsTrue(set.Union(other).SetEquals(result));
        }
        public void set_has_correct_content_after_adding_value(IntSet set, int value)
        {
            MutableIntSet editedSet = set.EditCopy();

            Assert.AreEqual(set.Contains(value), editedSet.Contains(value));
            editedSet.Add(value);
            Assert.IsTrue(editedSet.Contains(value));

            Assert.IsTrue(editedSet.Contains(value));
            Assert.IsTrue(set.Union(IntSet.Of(value)).SetEquals(editedSet));
            IntSet result = editedSet.CompleteAndDestroy();

            Assert.IsTrue(result.Contains(value));
            Assert.IsTrue(set.IsSubsetOf(result));
            Assert.IsTrue(set.Union(IntSet.Of(value)).SetEquals(result));
        }