PageRenderTime 51ms CodeModel.GetById 23ms RepoModel.GetById 1ms 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. //===================================================================================
  17. using System;
  18. using StockTraderRI.Infrastructure.Interfaces;
  19. using StockTraderRI.Infrastructure.Models;
  20. namespace StockTraderRI.Modules.Market.Tests.Mocks
  21. {
  22. internal class MockMarketHistoryService : IMarketHistoryService
  23. {
  24. public bool GetPriceHistoryCalled;
  25. public string GetPriceHistoryArgument;
  26. public MarketHistoryCollection Data = new MarketHistoryCollection();
  27. public MockMarketHistoryService()
  28. {
  29. Data.Add(new MarketHistoryItem { DateTimeMarker = new DateTime(2008, 1, 1), Value = 10.00m });
  30. Data.Add(new MarketHistoryItem { DateTimeMarker = new DateTime(2008, 6, 1), Value = 15.00m });
  31. }
  32. public MarketHistoryCollection GetPriceHistory(string tickerSymbol)
  33. {
  34. GetPriceHistoryCalled = true;
  35. GetPriceHistoryArgument = tickerSymbol;
  36. return Data;
  37. }
  38. }
  39. }