diff Stocks/Stocks.Service.Tests.Unit/StockServiceTests.cs @ 2:29ed98d659e9

Adding WebClientShim files
author stevenh7776 stevenhollidge@hotmail.com
date Mon, 20 Feb 2012 22:04:50 +0700
parents e5d46bb6cdb0
children 57f20ba55884
line wrap: on
line diff
--- a/Stocks/Stocks.Service.Tests.Unit/StockServiceTests.cs	Mon Feb 20 21:53:40 2012 +0700
+++ b/Stocks/Stocks.Service.Tests.Unit/StockServiceTests.cs	Mon Feb 20 22:04:50 2012 +0700
@@ -6,6 +6,7 @@
 using Stocks.Common;
 using System.Threading.Tasks;
 using System.Threading;
+using System.Net;
 
 namespace Stocks.Service.Tests.Unit
 {
@@ -15,13 +16,20 @@
     public void Service_IsActive_property()
     {
       var file = "../../../Stocks.Service/companyData.json";
-      var service = new StocksService(new ConfigurationService(file));
+      var configurationService = new ConfigurationService(file);
+      var webClientShim = new WebClientShim(new WebClient());
+      
+      var service = new StocksService(
+        configurationService, 
+        webClientShim);
+
+      Assert.Equal(false, service.IsActive);
 
       using (var task = Task.Factory.StartNew(() =>
         {
-          Assert.Equal(false, service.IsActive);
           service.Start();
           Assert.Equal(true, service.IsActive);
+      
           using (var task2 = Task.Factory.StartNew(() => Thread.Sleep(500)))
             { task2.Wait(); }
           service.Stop();