public void RemoteFileAddedWhileDeleteLocalCacheBeforeContinue() { var solver = new RemoteObjectAdded(this.session.Object, this.storage.Object, this.transmissionStorage.Object, this.transmissionManager, this.fsFactory.Object); this.RunSolverToAbortDownload(solver); this.RunSolverToDeleteLocalCacheBeforeContinue(solver); this.cacheFile.VerifySet(f => f.Uuid = It.Is <Guid?>(uuid => uuid != null && !uuid.Equals(Guid.Empty)), Times.Once()); this.cacheFile.Verify(f => f.MoveTo(this.localPath), Times.Once()); }
public void SetUp() { this.path = Path.Combine(Path.GetTempPath(), this.objectName); this.manager = new ActiveActivitiesManager(); this.session = new Mock <ISession>(); this.storage = new Mock <IMetaDataStorage>(); this.queue = new Mock <ISyncEventQueue>(); this.fsFactory = new Mock <IFileSystemInfoFactory>(MockBehavior.Strict); this.underTest = new RemoteObjectAdded(this.session.Object, this.storage.Object, this.queue.Object, this.manager, this.fsFactory.Object); }
public void SetUp() { this.path = Path.Combine(Path.GetTempPath(), this.objectName); this.manager = new TransmissionManager(); this.session = new Mock <ISession>(); this.session.SetupTypeSystem(); this.storage = new Mock <IMetaDataStorage>(); this.transmissionStorage = new Mock <IFileTransmissionStorage>(); this.fsFactory = new Mock <IFileSystemInfoFactory>(MockBehavior.Strict); this.underTest = new RemoteObjectAdded(this.session.Object, this.storage.Object, this.transmissionStorage.Object, this.manager, this.fsFactory.Object); }
public void RemoteFileAddedWithThreeSave() { Setup((int)((1024 * 1024 + 2 * this.chunkSize - 1 + 2 * this.chunkSize) / this.chunkSize)); var solver = new RemoteObjectAdded(this.session.Object, this.storage.Object, this.transmissionStorage.Object, this.transmissionManager, this.fsFactory.Object); this.RunSolverToAbortDownload(solver); this.RunSolverToContinueDownload(solver); this.transmissionStorage.Verify(f => f.SaveObject(It.IsAny <IFileTransmissionObject>()), Times.Exactly(3)); this.cacheFile.VerifySet(f => f.Uuid = It.Is <Guid?>(uuid => uuid != null && !uuid.Equals(Guid.Empty)), Times.Once()); this.cacheFile.Verify(f => f.MoveTo(this.localPath), Times.Once()); }