Ejemplo n.º 1
0
        public void DownloadAsyncTest()
        {
            // Arrange
            string filePath = String.Empty;
            string url = "http://somepage.com";
            var webClientStub = MockRepository.GenerateStub<WebClient>();

            // Act
            var wd = new WebDownloader(webClientStub);
            wd.DownloadAsync(filePath, url, (o,e)=>  {});

            // Assert
            webClientStub.AssertWasCalled(wc => wc.DownloadFileAsync(Arg<Uri>.Is.Equal(new Uri(url)), Arg<String>.Is.Equal(filePath)));
        }