/// <summary>Initializes a new instance of the <see cref="TransferFileBytesRequestObserver"/> class.</summary> /// <param name="fileTransferFactory">The download transfer factory.</param> /// <param name="peerSettings"></param> /// <param name="logger">The logger.</param> public TransferFileBytesRequestObserver(IDownloadFileTransferFactory fileTransferFactory, IPeerSettings peerSettings, ILogger logger) : base(logger, peerSettings) { _fileTransferFactory = fileTransferFactory; }
public GetFileFromDfsResponseObserverTests() { _logger = Substitute.For <ILogger>(); _fakeContext = Substitute.For <IChannelHandlerContext>(); _fileDownloadFactory = Substitute.For <IDownloadFileTransferFactory>(); _logger = Substitute.For <ILogger>(); }
public void Init() { _logger = Substitute.For <ILogger>(); _fakeContext = Substitute.For <IChannelHandlerContext>(); _fileDownloadFactory = Substitute.For <IDownloadFileTransferFactory>(); _logger = Substitute.For <ILogger>(); }
/// <summary>Initializes a new instance of the <see cref="AddFileToDfsRequestObserver"/> class.</summary> /// <param name="dfs">The DFS.</param> /// <param name="peerSettings"></param> /// <param name="fileTransferFactory">The download file transfer factory.</param> /// <param name="logger">The logger.</param> public AddFileToDfsRequestObserver(IDfs dfs, IPeerSettings peerSettings, IDownloadFileTransferFactory fileTransferFactory, ILogger logger) : base(logger, peerSettings) { _fileTransferFactory = fileTransferFactory; _dfs = dfs; }
public GetFileFromDfsObserverHandlerTests(ITestOutputHelper testOutput) : base(testOutput) { _hashProvider = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("blake2b-256")); _logger = Substitute.For <ILogger>(); _fakeContext = Substitute.For <IChannelHandlerContext>(); _fileDownloadFactory = new DownloadFileTransferFactory(_logger); _logger = Substitute.For <ILogger>(); _dfs = Substitute.For <IDfs>(); }
/// <summary>Initializes a new instance of the <see cref="AddFileToDfsRequestObserver" /> class.</summary> /// <param name="dfsService">The DFS.</param> /// <param name="peerSettings"></param> /// <param name="fileTransferFactory">The download file transfer factory.</param> /// <param name="hashProvider"></param> /// <param name="logger">The logger.</param> public AddFileToDfsRequestObserver(IDfsService dfsService, IPeerSettings peerSettings, IDownloadFileTransferFactory fileTransferFactory, IHashProvider hashProvider, ILogger logger) : base(logger, peerSettings) { _fileTransferFactory = fileTransferFactory; _dfsService = dfsService; _hashProvider = hashProvider; }
public TransferFileBytesRequestObserverTests() { _context = Substitute.For <IChannelHandlerContext>(); _context.Channel.Returns(Substitute.For <IChannel>()); _downloadFileTransferFactory = Substitute.For <IDownloadFileTransferFactory>(); var peerSettings = PeerIdHelper.GetPeerId("Test").ToSubstitutedPeerSettings(); _observer = new TransferFileBytesRequestObserver(_downloadFileTransferFactory, peerSettings, Substitute.For <ILogger>()); }
public void Init() { Setup(TestContext.CurrentContext); _hashProvider = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("keccak-256")); _logger = Substitute.For <ILogger>(); _fakeContext = Substitute.For <IChannelHandlerContext>(); _fileDownloadFactory = new DownloadFileTransferFactory(_logger); _logger = Substitute.For <ILogger>(); _dfsService = Substitute.For <IDfsService>(); }
public AddFileToDfsRequestObserverTests() { _hashProvider = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("blake2b-256")); _manualResetEvent = new ManualResetEvent(false); _senderIdentifier = PeerIdHelper.GetPeerId("sender"); var peerSettings = _senderIdentifier.ToSubstitutedPeerSettings(); _fakeDfs = Substitute.For <IDfs>(); var logger = Substitute.For <ILogger>(); _fakeContext = Substitute.For <IChannelHandlerContext>(); _nodeFileTransferFactory = Substitute.For <IDownloadFileTransferFactory>(); _addFileToDfsRequestObserver = new AddFileToDfsRequestObserver(_fakeDfs, peerSettings, _nodeFileTransferFactory, logger); }
public NodeFileTransferTests(ITestOutputHelper testOutput) : base(testOutput) { var hashProvider = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("blake2b-256")); _logger = Substitute.For <ILogger>(); _fakeContext = Substitute.For <IChannelHandlerContext>(); _nodeFileTransferFactory = new DownloadFileTransferFactory(_logger); var passwordManager = Substitute.For <IPasswordManager>(); passwordManager .RetrieveOrPromptAndAddPasswordToRegistry(PasswordRegistryTypes.IpfsPassword, Arg.Any <string>()) .Returns(TestPasswordReader.BuildSecureStringPassword("abcd")); var ipfsEngine = new IpfsAdapter(passwordManager, FileSystem, _logger); _logger = Substitute.For <ILogger>(); _dfs = new Dfs(ipfsEngine, hashProvider, _logger); }
/// <summary>Initializes a new instance of the <see cref="TransferFileBytesResponseObserver"/> class.</summary> /// <param name="fileTransferFactory">The download transfer factory.</param> /// <param name="logger">The logger.</param> public TransferFileBytesResponseObserver(IDownloadFileTransferFactory fileTransferFactory, ILogger logger) : base(logger, false) { _fileTransferFactory = fileTransferFactory; }
public DownloadFileTransferFactoryTests() { _downloadFileTransferFactory = new DownloadFileTransferFactory(Substitute.For <ILogger>()); }
public GetFileCommand(IDownloadFileTransferFactory downloadFileTransferFactory, ICommandContext commandContext, ILogger logger) : base(commandContext, logger) { _downloadFileTransferFactory = downloadFileTransferFactory; }
/// <summary>Initializes a new instance of the <see cref="GetFileFromDfsResponseObserver"/> class.</summary> /// <param name="logger">The logger.</param> /// <param name="fileTransferFactory">The file transfer.</param> public GetFileFromDfsResponseObserver(ILogger logger, IDownloadFileTransferFactory fileTransferFactory) : base(logger) { _fileTransferFactory = fileTransferFactory; }