ParseOutput() public method

public ParseOutput ( Process sender, string data, ITransferProgress progress ) : void
sender System.Diagnostics.Process
data string
progress ITransferProgress
return void
Example #1
0
 LaunchAndProcessInfo BuildProcessInfo(ITransferProgress progress, string source, string destination,
                                       RsyncOptions options) => new LaunchAndProcessInfo(GetProcessStartInfo(source, destination, options))
 {
     StandardOutputAction = (process, data) => _parser.ParseOutput(process, data, progress),
     StandardErrorAction  = (process, data) => _parser.ParseOutput(process, data, progress),
     MonitorOutput        = _processManager.DefaultMonitorOutputTimeOut,
     MonitorResponding    = _processManager.DefaultMonitorRespondingTimeOut
 };
        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));
        }