private static NetworkConnection ResolveErrorLogDownloadUrl(NetworkConnection connection, KeyValuePair<Uri, DateTime> entry)
		{
			var url = entry.Key.AbsoluteUri.Replace("/detail?", "/xml?");
			
			if (connection.IsHttps)
			{
				url = url.Replace("http:", "https:");
			}

			return connection.CopyWithCredentials(url);
		}
        public void CreateWithCredentials_CreatesNewConnectionAndCopiesCredentialsFromTheOriginal()
        {
            // arrange
            var url = "http://www.test.com/elmah.axd";
            var original = new NetworkConnection(url);

            original.SetCredentials("pelle", "password", "domain1");

            // act
            var copy = original.CopyWithCredentials("http://www.copy.com/elmah.axd");

            // assert
            Assert.That(copy.Uri.AbsoluteUri, Is.EqualTo("http://www.copy.com/elmah.axd"));
            Assert.That(copy.GetCredentials(), Is.EqualTo(original.GetCredentials()));
        }