public void StartDownload()
        {
            _client.Download(Arg.Any <Url>()).Returns(DelayReturns(new WebResult {
                Url = Url.Create(TestDomain), ErrorCode = 200, Data = ""
            }));

            var x = GetNewDomainLoader;

            Assert.DoesNotThrowAsync(() => x.Download());
            _client.Received(1).Download(Arg.Is(Url.Create(TestDomain)));
        }
        /// <summary>
        /// Downloads attachment to specified file
        /// </summary>
        /// <param name="fullFileName">Full file name where attachment will be downloaded</param>
        public void Download(string fullFileName)
        {
            AddAuthenticationToRequest(_webClient, _jira);
            var url = GetRequestUrl();

            _webClient.Download(url, fullFileName);
        }
示例#3
0
        public void Setup()
        {
            client = Substitute.For<IWebClient>();
            client.Download().Returns(downloadStringResult);

            target = new WebRequestBuilder(client);
        }