public void SaveYahooData(IList <YahooNormalized> yahooRecords, string path) { var yahooTreeData = YahooHelper.BuildYahooTreeDataList(yahooRecords); _yahooTreeDataRepository.CollectionName = "Yahoo"; _yahooTreeDataRepository.Path = path; _yahooTreeDataRepository.NamesFileContents = YahooHelper.BuildYahooNamesFile(); _yahooTreeDataRepository.SaveData(yahooTreeData); }
public void BuildYahooTreeDataList_ShouldPreserveVolatilities() { var yahooTreeDataList = YahooHelper.BuildYahooTreeDataList(_yahooRecords).ToList(); Assert.AreEqual(1.25, yahooTreeDataList[0].Volatility); Assert.AreEqual(1.26, yahooTreeDataList[1].Volatility); Assert.AreEqual(1.27, yahooTreeDataList[2].Volatility); Assert.AreEqual(1.28, yahooTreeDataList[3].Volatility); Assert.AreEqual(1.29, yahooTreeDataList[4].Volatility); }
public void BuildYahooTreeDataList_ShouldSaveCorrectActions() { var yahooTreeDataList = YahooHelper.BuildYahooTreeDataList(_yahooRecords).ToList(); Assert.AreEqual(MarketAction.Buy, yahooTreeDataList[0].Action); Assert.AreEqual(MarketAction.Sell, yahooTreeDataList[1].Action); Assert.AreEqual(MarketAction.Buy, yahooTreeDataList[2].Action); Assert.AreEqual(MarketAction.Sell, yahooTreeDataList[3].Action); Assert.AreEqual(MarketAction.Hold, yahooTreeDataList[4].Action); }
public void BuildYahooTreeDataList_ShouldGetCorrectCount() { var yahooTreeDataList = YahooHelper.BuildYahooTreeDataList(_yahooRecords).ToList(); Assert.AreEqual(5, yahooTreeDataList.Count); }