public void GetWebRequest(string url, bool authenticate, string userName, string password)
        {
            int          timeout           = 0;
            ICredentials networkCredential = null;

            Mock <IWebRequestFactory> webRequestFactoryMock = new Mock <IWebRequestFactory>();
            Mock <WebRequest>         webRequestMock        = new Mock <WebRequest>();

            webRequestMock.SetupSet(x => x.Timeout).Callback(x => timeout = x);
            webRequestMock.SetupSet(x => x.Credentials).Callback(x => networkCredential = x);
            webRequestFactoryMock.Setup(x => x.CreateRequest(new Uri(url))).Returns(() => webRequestMock.Object);

            WebRequestManager webRequestManager = new WebRequestManager(webRequestFactoryMock.Object);
            WebRequest        webRequest        = webRequestManager.GetWebRequest(new DownloadFileInfo(new Uri(url), "file1.txt", 5, authenticate, userName, password));

            Assert.AreSame(webRequestMock.Object, webRequest);
            Assert.AreEqual(30000, timeout);
            if (authenticate)
            {
                Assert.AreEqual(((NetworkCredential)networkCredential).UserName, userName);
                Assert.AreEqual(((NetworkCredential)networkCredential).Password, password);
            }
        }