public void MongoContentCollectionRemoveTest() { var collection = new MongoContentCollection <TestContentType>(); var probe = TestContentType.getARandomTestContentType(enforce_a_reference: false); collection.Clear(); collection.Add(probe); collection.Remove(probe); Assert.IsTrue(collection.isEmpty); }
public void MongoContentCollectionRemoveContentsTest() { var collection = new MongoContentCollection <TestContentType>(); collection.Clear(); var probe = TestContentType.getARandomTestContentType(enforce_a_reference: false); var contents = new List <IContent>(from x in Enumerable.Range(0, 10) select TestContentType.getARandomTestContentType(enforce_a_reference: false)); contents.Add(probe); collection.AddContents(contents); Assert.IsTrue(collection.Contains(probe)); collection.Remove(probe); Assert.IsFalse(collection.Contains(probe)); }