コード例 #1
0
        public void ShouldBeAbleToBuildListOfQuotesFromJsonFile()
        {
            string sampleJSONQuoteFilePath      = "..\\..\\..\\Samples\\EFC-ByMinute-201912090230-201912200906.json";
            List <DataModels.Quote> EFCbyMinute = ReadWriteJSONToDisk.getQuotesFromJSON(sampleJSONQuoteFilePath);

            Assert.IsTrue(EFCbyMinute.Count > 3);
        }
コード例 #2
0
        public void MapCombiningPriceLists()
        {
            string sampleJSONQuoteFilePath1          = "..\\..\\..\\Samples\\EFC-ByMinute-201912090230-201912200906.json";
            string sampleJSONQuoteFilePath2          = "..\\..\\..\\Samples\\EFC-ByMinute-201912110230-201912240607.json";
            List <DataModels.Quote> EFCbyMinute1     = ReadWriteJSONToDisk.getQuotesFromJSON(sampleJSONQuoteFilePath1);
            List <DataModels.Quote> EFCbyMinute2     = ReadWriteJSONToDisk.getQuotesFromJSON(sampleJSONQuoteFilePath2);
            List <DataModels.Quote> EFCbyMinuteFinal = EFCbyMinute1.Union(EFCbyMinute2, new DataModels.CompareQuoteByDatetime())
                                                       .OrderBy(o => o.datetime)
                                                       .ToList();

            Assert.IsTrue(EFCbyMinuteFinal.Count > EFCbyMinute1.Count && EFCbyMinuteFinal.Count > EFCbyMinute2.Count);
            Assert.IsTrue(EFCbyMinuteFinal.Contains(EFCbyMinute1.First()) && EFCbyMinuteFinal.Contains(EFCbyMinute1.Last()));
            //foreach (DataModels.Quote thisQuote in EFCbyMinute2)
            //    Assert.IsTrue(EFCbyMinuteFinal.Contains(thisQuote));
            List <DataModels.Quote> StockHistoryCombinedList = StockHistory.CombineQuoteLists(EFCbyMinute1, EFCbyMinute2);

            Assert.IsTrue(StockHistoryCombinedList.Count == EFCbyMinuteFinal.Count);
        }