Mercurial > silverbladetech
view Stocks/Stocks.Common/WebClientShim.cs @ 7:cdc88fd7cb89
Removable of packages from scc now Nuget can restore on build
author | stevenh7776 stevenhollidge@hotmail.com |
---|---|
date | Tue, 21 Feb 2012 01:19:54 +0700 |
parents | c812bca7b1ac |
children | 6e84a4c92378 |
line wrap: on
line source
using System.Net; using System; namespace Stocks.Common { // Shim to wrap WebClient component to allow the shim to // be mocked or stubbed for unit tests. // Favours injection and composition over inheritence public class WebClientShim : IWebClientShim { private WebClient _webClient; public WebClientShim(WebClient webClient) { _webClient = webClient; } // add event handlers to the shim if you wish // to hook into DownloadStringCompleted event public string DownloadString(string address) { return _webClient.DownloadString(address).ToString(); } public void Dispose() { _webClient.Dispose(); } } }