diff --git a/MarketDataUnitTests/MarketDataFeedTests.cs b/MarketDataUnitTests/MarketDataFeedTests.cs index 7e1a408..809fa9b 100644 --- a/MarketDataUnitTests/MarketDataFeedTests.cs +++ b/MarketDataUnitTests/MarketDataFeedTests.cs @@ -272,7 +272,7 @@ namespace MarketDataUnitTests [TestMethod] public void CompanyProfileRetrieval() { - String symbol="MIDD"; + String symbol="MOD"; CompanyProfile companyProfile=MarketDataHelper.GetCompanyProfile(symbol); Assert.IsTrue(null!=companyProfile); } @@ -403,19 +403,35 @@ namespace MarketDataUnitTests [TestMethod] public void CashflowStatementMorningStarRetrieval() { - String symbol="MIDD"; - List cashflowStatements = MarketDataHelper.GetCashflowStatement(symbol, CashflowStatement.PeriodType.Annual); - Assert.IsTrue(null != cashflowStatements && cashflowStatements.Count > 0); - CashflowStatement cashflowStatement = cashflowStatements[0]; - Assert.IsTrue(!double.IsNaN(cashflowStatement.DepreciationAndAmortization),"DepreciationAndAmortization"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.DeferredIncomeTaxes),"DeferredIncomeTaxes"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.StockBasedCompensation),"StockBasedCompensation"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.AccountsReceivable),"AccountsReceivable"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.Inventory),"Inventory"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.AccountsPayable),"AccountsPayable"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.AccruedLiabilities),"AccruedLiabilities"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.OperatingCashflow),"OperatingCashflow"); - Assert.IsTrue(!double.IsNaN(cashflowStatement.FreeCashflow),"FreeCashflow"); + String[] symbols = {"AZEK", "CPRT", "DOCU", "ESTC", "HLNE"}; + + Dictionary> cashflowStatementsDict = new Dictionary>(); + + foreach(String symbol in symbols) + { + List cashflowStatements = MarketDataHelper.GetCashflowStatement(symbol, CashflowStatement.PeriodType.Annual); + if(null == cashflowStatements)continue; + cashflowStatementsDict.Add(symbol, cashflowStatements); + } + + Assert.IsTrue(cashflowStatementsDict.Count!=0,"Error retrieving cashflow statements."); + + List keys = cashflowStatementsDict.Keys.ToList(); + + foreach(String key in keys) + { + List cashflowStatements = cashflowStatementsDict[key]; + CashflowStatement cashflowStatement = cashflowStatements[0]; + Assert.IsTrue(!double.IsNaN(cashflowStatement.DepreciationAndAmortization), $"DepreciationAndAmortization for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.DeferredIncomeTaxes), $"DeferredIncomeTaxes for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.StockBasedCompensation), $"StockBasedCompensation for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.AccountsReceivable), $"AccountsReceivable for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.Inventory), $"Inventory for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.AccountsPayable), $"AccountsPayable for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.AccruedLiabilities), $"AccruedLiabilities for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.OperatingCashflow), $"OperatingCashflow for {key}"); + Assert.IsTrue(!double.IsNaN(cashflowStatement.FreeCashflow), $"FreeCashflow for {key}"); + } } [TestMethod]