예제 #1
0
        public async void CanCallDiffTool()
        {
            var baseContent = MockFile1PersistFor("baseContent", _pullRequest.Base.Sha);
            var headContent = MockFile1PersistFor("headContent", _pullRequest.Head.Sha);

            const string basePath = "basepath";

            _fileContentPersist.SaveContent(Arg.Any <PullRequestLocator>(),
                                            Arg.Any <string>(),
                                            baseContent.Content).Returns(Task.FromResult(basePath));
            const string headPath = "headpath";

            _fileContentPersist.SaveContent(Arg.Any <PullRequestLocator>(),
                                            Arg.Any <string>(),
                                            headContent.Content).Returns(Task.FromResult(headPath));

            _mainWindowVm.SelectedDiffFile = new CommitFileVm(_compareResults.File1);

            await _mainWindowVm.RetrieveDiffs();

            await _mainWindowVm.PrepareDiffContent();

            _diffTool.Received(1).Open(basePath, headPath);
        }
예제 #2
0
 public async Task <string> SaveToFile(string fileName, string content)
 {
     return(await _fileContentPersist.SaveContent(PullRequestLocator, fileName, content));
 }