GetObjectByRemoteObjectId() public method

public GetObjectByRemoteObjectId ( string remoteObjectId ) : IFileTransmissionObject
remoteObjectId string
return IFileTransmissionObject
コード例 #1
0
        public void SaveObjectBehaviorOverride() {
            var storage = new FileTransmissionStorage(this.engine);
            this.remoteFile.Setup(m => m.Id).Returns("RemoteObjectId");

            for (int i = 1; i <= 10; ++i) {
                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(1));
                Assert.That(storage.GetObjectList().First(foo => foo.LocalPath == this.localFile.Object.FullName && foo.RemoteObjectId == "RemoteObjectId"), Is.Not.Null);
                Assert.That(storage.GetObjectByRemoteObjectId("RemoteObjectId"), Is.Not.Null);
            }
        }