ClearObjectList() public method

Clears the object list.
public ClearObjectList ( ) : void
return void
コード例 #1
0
        public void ClearObjectList() {
            var storage = new FileTransmissionStorage(this.engine);

            for (int i = 1; i <= 10; ++i) {
                this.remoteFile.Setup(m => m.Id).Returns("RemoteObjectId" + i.ToString());
                var obj = new FileTransmissionObject(TransmissionType.UPLOAD_NEW_FILE, this.localFile.Object, this.remoteFile.Object);
                Assert.DoesNotThrow(() => storage.SaveObject(obj));
                Assert.That(storage.GetObjectList().Count, Is.EqualTo(i));
                Assert.That(storage.GetObjectList().First(foo => foo.LocalPath == this.localFile.Object.FullName && foo.RemoteObjectId == "RemoteObjectId" + i.ToString()), Is.Not.Null);
            }

            storage.ClearObjectList();

            Assert.That(storage.GetObjectList().Count, Is.EqualTo(0));
        }