示例#1
0
        public static void InsightCollectionShouldBeAbleToBeConvertedToListWithoutStackOverflow()
        {
            var aapl = Symbol.Create("AAPL", SecurityType.Equity, "usa");
            var insightCollection = new InsightCollection();

            insightCollection.Add(new Insight(aapl, new TimeSpan(1, 0, 0, 0), InsightType.Price, InsightDirection.Up)
            {
                CloseTimeUtc = new DateTime(2019, 1, 1),
            });
            insightCollection.Add(new Insight(aapl, new TimeSpan(1, 0, 0, 0), InsightType.Volatility, InsightDirection.Up)
            {
                CloseTimeUtc = new DateTime(2019, 1, 2),
            });

            Assert.DoesNotThrow(() => insightCollection.OrderBy(x => x.CloseTimeUtc).ToList());
        }