Ejemplo n.º 1
0
        public void SaveYahooData_ShouldSetYahooTreeMetaData()
        {
            _service.SaveYahooData(new List <YahooNormalized>(), "testPath");

            _yahooTreeDataRepositoryMock.VerifySet(x => x.CollectionName    = "Yahoo", Times.Once);
            _yahooTreeDataRepositoryMock.VerifySet(x => x.Path              = "testPath", Times.Once);
            _yahooTreeDataRepositoryMock.VerifySet(x => x.NamesFileContents = YahooHelper.BuildYahooNamesFile(), Times.Once);
        }
        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 BuildYahooNamesFile_ShouldBuildCorrectFile()
        {
            var builder = new StringBuilder();

            builder.AppendLine("Buy,Sell,Hold.	|classes");
            builder.AppendLine();
            builder.AppendLine("Spread:	continuous.");
            builder.AppendLine("Change:	continuous.");
            builder.AppendLine("Volatility:	continuous.");

            var namesFile = YahooHelper.BuildYahooNamesFile();

            Assert.AreEqual(builder.ToString(), namesFile);
        }