/// <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 upload file transfer factory.</param>
 /// <param name="logger">The logger.</param>
 public GetFileFromDfsRequestObserver(IDfsService dfsService,
                                      IPeerSettings peerSettings,
                                      IUploadFileTransferFactory fileTransferFactory,
                                      ILogger logger) : base(logger, peerSettings)
 {
     _fileTransferFactory = fileTransferFactory;
     _dfsService          = dfsService;
 }
        public GetFileFromDfsRequestObserverTests()
        {
            _hashProvider        = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("blake2b-256"));
            _fileTransferFactory = Substitute.For <IUploadFileTransferFactory>();
            _dfs = Substitute.For <IDfs>();
            var peerSettings = PeerIdHelper.GetPeerId("test").ToSubstitutedPeerSettings();

            _observer = new GetFileFromDfsRequestObserver(_dfs, _hashProvider, peerSettings, _fileTransferFactory,
                                                          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 upload file transfer factory.</param>
 /// <param name="logger">The logger.</param>
 public GetFileFromDfsRequestObserver(IDfs dfs,
                                      IHashProvider hashProvider,
                                      IPeerSettings peerSettings,
                                      IUploadFileTransferFactory fileTransferFactory,
                                      ILogger logger) : base(logger, peerSettings)
 {
     _hashProvider        = hashProvider;
     _fileTransferFactory = fileTransferFactory;
     _dfs = dfs;
 }
Exemplo n.º 4
0
        public void Init()
        {
            _hashProvider        = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("keccak-256"));
            _fileTransferFactory = Substitute.For <IUploadFileTransferFactory>();
            _dfsService          = Substitute.For <IDfsService>();
            var peerSettings = PeerIdHelper.GetPeerId("test").ToSubstitutedPeerSettings();

            _observer = new GetFileFromDfsRequestObserver(_dfsService, peerSettings, _fileTransferFactory,
                                                          Substitute.For <ILogger>());
        }
 public AddFileCommand(IUploadFileTransferFactory uploadFileTransferFactory,
                       ICommandContext commandContext, ILogger logger) : base(commandContext, logger)
 {
     _uploadFileTransferFactory = uploadFileTransferFactory;
 }
 public UploadFileTransferFactoryTests()
 {
     _uploadFileTransferFactory = new UploadFileTransferFactory(Substitute.For <ILogger>());
 }
Exemplo n.º 7
0
 /// <summary>Initializes a new instance of the <see cref="AddFileToDfsResponseObserver"/> class.</summary>
 /// <param name="logger">The logger.</param>
 /// <param name="rpcFileTransferFactory">The upload file transfer factory</param>
 public AddFileToDfsResponseObserver(ILogger logger,
                                     IUploadFileTransferFactory rpcFileTransferFactory) : base(logger)
 {
     _rpcFileTransferFactory = rpcFileTransferFactory;
 }
 public void Init()
 {
     _uploadFileTransferFactory = new UploadFileTransferFactory(Substitute.For<ILogger>());
 }