public async Task Pass_DisplayUrl_To_ShowCloneDialog() { var displayUrl = "https://github.com/owner/displayUrl"; var browseOnlineUrl = "https://github.com/owner/browseOnlineUrl"; var remoteCodeContainer = new RemoteCodeContainer("Name", Guid.NewGuid(), new Uri(displayUrl), new Uri(browseOnlineUrl), DateTimeOffset.Now, new Dictionary <string, string>()); var downloadProgress = Substitute.For <IProgress <ServiceProgressData> >(); var cancellationToken = CancellationToken.None; var dialogService = Substitute.For <IDialogService>(); var result = new CloneDialogResult(@"x:\repo", "https://github.com/owner/repo"); dialogService.ShowCloneDialog(null).ReturnsForAnyArgs(result); var cloneService = Substitute.For <IRepositoryCloneService>(); var target = CreateGitHubContainerProvider(dialogService: dialogService, cloneService: cloneService); await target.AcquireCodeContainerAsync(remoteCodeContainer, downloadProgress, cancellationToken); await dialogService.Received(1).ShowCloneDialog(Arg.Any <IConnection>(), displayUrl); }
public async Task <CodeContainer> AcquireCodeContainerAsync(RemoteCodeContainer onlineCodeContainer, IProgress <ServiceProgressData> downloadProgress, CancellationToken cancellationToken) { var repository = new RepositoryModel(onlineCodeContainer.Name, UriString.ToUriString(onlineCodeContainer.DisplayUrl)); return(await RunAcquisition(downloadProgress, cancellationToken, repository)); }
public Task <CodeContainer> AcquireCodeContainerAsync(RemoteCodeContainer onlineCodeContainer, IProgress <ServiceProgressData> downloadProgress, CancellationToken cancellationToken) { // Implementing this interface member is required, // but it will never be used. return(null); }
public async Task <CodeContainer> AcquireCodeContainerAsync(RemoteCodeContainer onlineCodeContainer, IProgress <ServiceProgressData> downloadProgress, CancellationToken cancellationToken) { var url = onlineCodeContainer.DisplayUrl.ToString(); return(await RunAcquisitionAsync(downloadProgress, cancellationToken, url)); }
public Task <CodeContainer> AcquireCodeContainerAsync(RemoteCodeContainer onlineCodeContainer, IProgress <ServiceProgressData> downloadProgress, CancellationToken cancellationToken) { throw new NotImplementedException(); }