public void GetFileRequestHandlerInitializesFileUpload() { using (GetFakeDfsStream(FileTransferResponseCodeTypes.Successful)) { _observer.OnNext(GetFileFromDfsRequestMessage()); _dfs.Received(1).ReadAsync(Arg.Any <Cid>()); _fileTransferFactory.Received(1) .FileTransferAsync(Arg.Any <ICorrelationId>(), Arg.Any <CancellationToken>()); } }
public void TryReadDeltaFromDfs_Should_Pass_Cancellation_Token() { var cid = _hashProvider.ComputeUtf8MultiHash("good hash").CreateCid(); var cancellationToken = new CancellationToken(); var matchingDelta = DeltaHelper.GetDelta(_hashProvider); _dfs.ReadAsync(cid, CancellationToken.None) .Returns(matchingDelta.ToByteArray().ToMemoryStream()); _dfsReader.TryReadDeltaFromDfs(cid, out _, CancellationToken.None); _dfs.Received(1)?.ReadAsync(Arg.Is(cid), Arg.Is(cancellationToken)); }