RemoveObject() public méthode

Removes the saved object.
public RemoveObject ( IMappedObject obj ) : void
obj IMappedObject /// Object to be removed. ///
Résultat void
        public void RemoveObjectDoesNotTouchParents([Values(true, false)]bool withValidation) {
            string remoteId = "remoteId";
            string childId = "childId";
            string subChildId = "subchildId";
            var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
            var obj = new MappedObject("name", remoteId, MappedObjectType.Folder, null, null);
            var child = new MappedObject("child", childId, MappedObjectType.Folder, remoteId, null);
            var subchild = new MappedObject("subchild", subChildId, MappedObjectType.File, childId, null);
            storage.SaveMappedObject(obj);
            storage.SaveMappedObject(child);
            storage.SaveMappedObject(subchild);

            storage.RemoveObject(child);

            Assert.That(storage.GetObjectByRemoteId(remoteId), Is.EqualTo(obj));
            Assert.That(storage.GetObjectByRemoteId(childId), Is.Null);
            Assert.That(storage.GetObjectByRemoteId(subChildId), Is.Null);
        }
 public void RemoveObjectThrowsExceptionOnNonExistingIdInObject([Values(true, false)]bool withValidation) {
     var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
     Assert.Throws<ArgumentException>(() => storage.RemoveObject(Mock.Of<IMappedObject>()));
 }
        public void RemoveObjectTest([Values(true, false)]bool withValidation) {
            string remoteId = "remoteId";
            var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
            var obj = new MappedObject("name", remoteId, MappedObjectType.Folder, null, null);
            storage.SaveMappedObject(obj);

            storage.RemoveObject(obj);

            Assert.That(storage.GetObjectByRemoteId(remoteId), Is.Null);
        }
 public void RemoveObjectThrowsExceptionOnNullArgument([Values(true, false)]bool withValidation) {
     var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
     Assert.Throws<ArgumentNullException>(() => storage.RemoveObject(null));
 }