public async Task AllOpenCloseEvents_TimespanCloseOpenCloseOnlyMarket_ReturnOneOpenAndTwoClose()
        {
            var manager    = new MarketOpenCloseEventService(this._repository, this._logger);
            var earlyStart = new DateTime(2000, 1, 1, 15, 0, 0);
            var earlyEnd   = new DateTime(2000, 1, 2, 23, 0, 0);

            var results = await manager.AllOpenCloseEvents(earlyStart, earlyEnd);

            var firstResult  = results.Skip(2).FirstOrDefault();
            var secondResult = results.Skip(3).FirstOrDefault();
            var thirdResult  = results.Skip(4).FirstOrDefault();

            Assert.AreEqual(results.Count, 7);

            Assert.IsNotNull(firstResult);
            Assert.AreEqual(firstResult.EventTime, new DateTime(2000, 1, 1, 16, 30, 0));
            Assert.AreEqual(firstResult.StateChange, UniverseStateEvent.ExchangeClose);

            Assert.IsNotNull(secondResult);
            Assert.AreEqual(secondResult.EventTime, new DateTime(2000, 1, 2, 8, 0, 0));
            Assert.AreEqual(secondResult.StateChange, UniverseStateEvent.ExchangeOpen);

            Assert.IsNotNull(thirdResult);
            Assert.AreEqual(thirdResult.EventTime, new DateTime(2000, 1, 2, 16, 30, 0));
            Assert.AreEqual(thirdResult.StateChange, UniverseStateEvent.ExchangeClose);
        }
        public async Task AllOpenCloseEvents_TimespanFiveDaysBeforeFinalClose_ReturnsNineEvents()
        {
            var manager = new MarketOpenCloseEventService(this._repository, this._logger);
            var start   = new DateTime(2000, 1, 1, 13, 0, 0);
            var end     = new DateTime(2000, 1, 5, 21, 0, 0);

            var results = await manager.AllOpenCloseEvents(start, end);

            Assert.AreEqual(results.Count, 13);
        }
        public async Task AllOpenCloseEvents_TimespanTooShortForMarketBeforeOpen_ReturnEmpty()
        {
            var manager    = new MarketOpenCloseEventService(this._repository, this._logger);
            var earlyStart = new DateTime(2000, 1, 1, 3, 0, 0);
            var earlyEnd   = new DateTime(2000, 1, 1, 4, 0, 0);

            var results = await manager.AllOpenCloseEvents(earlyStart, earlyEnd);

            Assert.AreEqual(results.Count, 4);
        }