PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/V4/StockTrader RI/Desktop/StockTraderRI.Modules.Market.Tests/Mocks/MockMarketHistoryService.cs

#
C# | 43 lines | 23 code | 4 blank | 16 comment | 0 complexity | 06522868c7dbf2af7366d6ddd3cfe758 MD5 | raw file
 1//===================================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation and Silverlight
 4//===================================================================================
 5// Copyright (c) Microsoft Corporation.  All rights reserved.
 6// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 7// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 8// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 9// FITNESS FOR A PARTICULAR PURPOSE.
10//===================================================================================
11// The example companies, organizations, products, domain names,
12// e-mail addresses, logos, people, places, and events depicted
13// herein are fictitious.  No association with any real company,
14// organization, product, domain name, email address, logo, person,
15// places, or events is intended or should be inferred.
16//===================================================================================
17using System;
18using StockTraderRI.Infrastructure.Interfaces;
19using StockTraderRI.Infrastructure.Models;
20
21namespace StockTraderRI.Modules.Market.Tests.Mocks
22{
23    internal class MockMarketHistoryService : IMarketHistoryService
24    {
25        public bool GetPriceHistoryCalled;
26        public string GetPriceHistoryArgument;
27        public MarketHistoryCollection Data = new MarketHistoryCollection();
28
29        public MockMarketHistoryService()
30        {
31            Data.Add(new MarketHistoryItem { DateTimeMarker = new DateTime(2008, 1, 1), Value = 10.00m });
32            Data.Add(new MarketHistoryItem { DateTimeMarker = new DateTime(2008, 6, 1), Value = 15.00m });
33        }
34
35        public MarketHistoryCollection GetPriceHistory(string tickerSymbol)
36        {
37            GetPriceHistoryCalled = true;
38            GetPriceHistoryArgument = tickerSymbol;
39
40            return Data;
41        }
42    }
43}