public void DownloadsAUrl()
        {
            var targetRequest = WebRequest.CreateHttp("https://tddapps.com");

            _webRequestFactory.CreateHttp("my url")
            .Returns(targetRequest);

            _webRequestExecutor.Run(targetRequest)
            .Returns("tdd rocks");

            _downloader
            .Download("my url")
            .Should()
            .Be("tdd rocks");
        }
        public void DownloadsAUrl()
        {
            var proxy         = new ProxyInfo("192.168.1.1:8080");
            var targetRequest = WebRequest.CreateHttp("https://tddapps.com");

            _webRequestFactory.CreateHttp("my url", proxy)
            .Returns(targetRequest);

            _webRequestExecutor.Run(targetRequest)
            .Returns("tdd rocks");

            _downloader
            .Download("my url", proxy)
            .Should()
            .Be("tdd rocks");
        }
 public string Download(string url, ProxyInfo proxy) =>
 _webRequestFactory
 .CreateHttp(url, proxy)
 .InstrumentedDownload(DownloadInternal);
Example #4
0
 public string Download(string url) =>
 _webRequestFactory
 .CreateHttp(url)
 .InstrumentedDownload(DownloadInternal);