GildedRose-Refactoring-Kata/TestNinja/TestNinja/Mocking/InstallerHelper.cs
2018-11-11 18:50:47 +01:00

28 lines
677 B
C#

using System.Net;
namespace TestNinja.Mocking
{
public class InstallerHelper
{
private string _setupDestinationFile;
public bool DownloadInstaller(string customerName, string installerName)
{
var client = new WebClient();
try
{
client.DownloadFile(
string.Format("http://example.com/{0}/{1}",
customerName,
installerName),
_setupDestinationFile);
return true;
}
catch (WebException)
{
return false;
}
}
}
}