public void Setup()
        {
            _standardOutputStream = new MemoryStream();
            _standardErrorStream  = new MemoryStream();
            _outputStreamReader   = new StreamReader(_standardOutputStream);
            _errorStreamReader    = new StreamReader(_standardErrorStream);

            _process = Substitute.For <IProcess>();
            _process.StandardOutput.Returns(x => _outputStreamReader);
            _process.StandardError.Returns(x => _errorStreamReader);

            _executable = Substitute.For <IExecutable>();
            _executable.Start(Arg.Any <ArgumentString>(), Arg.Any <bool>(), Arg.Any <bool>(), Arg.Any <bool>(), Arg.Any <Encoding>()).Returns(x => _process);

            _provider = new AheadBehindDataProvider(() => _executable);
        }
Пример #2
0
 public TestAccessor(AheadBehindDataProvider provider)
 {
     _provider = provider;
 }
Пример #3
0
 public void InitializeAheadBehindProvider()
 {
     _aheadBehindDataProvider = GitVersion.Current.SupportAheadBehindData
         ? new AheadBehindDataProvider(() => Module.GitExecutable)
         : null;
 }