Inheritance: OutputParser
        public void ParseOutput() {
            var parser = new RsyncOutputParser();
            var progress = A.Fake<ITransferProgress>();
            var process = new Process();
            parser.ParseOutput(process, "3.51M  43%  177.98kB/s    0:00:25", progress);

            progress.Progress.Should().Be(43);
            progress.Speed.Should().Be((long) (177.98*1024));
            progress.Eta.Should().Be(TimeSpan.FromSeconds(25));
        }
        public RsyncLauncher(IProcessManager processManager, IPathConfiguration configuration,
            RsyncOutputParser parser) {
            if (processManager == null)
                throw new ArgumentNullException(nameof(processManager));
            if (configuration == null)
                throw new ArgumentNullException(nameof(configuration));

            _processManager = processManager;
            _parser = parser;
            _binPath = configuration.ToolCygwinBinPath.GetChildFileWithName("rsync.exe");
            _sshBinPath = configuration.ToolCygwinBinPath.GetChildFileWithName("ssh.exe");
        }
Example #3
0
        public RsyncLauncher(IProcessManager processManager, IPathConfiguration configuration,
                             RsyncOutputParser parser)
        {
            if (processManager == null)
            {
                throw new ArgumentNullException(nameof(processManager));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            _processManager = processManager;
            _parser         = parser;
            _binPath        = configuration.ToolCygwinBinPath.GetChildFileWithName("rsync.exe");
            _sshBinPath     = configuration.ToolCygwinBinPath.GetChildFileWithName("ssh.exe");
        }