Example #1
0
        public RsyncLauncher(IProcessManager processManager, IPathConfiguration configuration,
            RsyncOutputParser parser) {
            if (processManager == null)
                throw new ArgumentNullException("processManager");
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _processManager = processManager;
            _parser = parser;
            _binPath = configuration.ToolCygwinBinPath.GetChildFileWithName("rsync.exe");
            _sshBinPath = configuration.ToolCygwinBinPath.GetChildFileWithName("ssh.exe");
        }
        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));
        }