예제 #1
0
        public void Retrieves()
        {
            var fileProviderTest = new LocalZipMapFileProviderTest();
            var dataProviderTest = new DefaultDataProviderTest();

            fileProviderTest.Initialize(dataProviderTest);

            var mapFileResolver = fileProviderTest.Get(QuantConnect.Market.USA);

            fileProviderTest.Enabled = false;
            dataProviderTest.DisposeSafely();

            Assert.IsNotEmpty(mapFileResolver);
        }
예제 #2
0
        public void Retrieves()
        {
            var fileProviderTest = new LocalZipMapFileProviderTest();
            var dataProviderTest = new DefaultDataProviderTest();

            fileProviderTest.Initialize(dataProviderTest);

            var mapFileResolver = fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);

            fileProviderTest.Enabled = false;
            dataProviderTest.DisposeSafely();

            Assert.IsNotEmpty(mapFileResolver);
        }
예제 #3
0
        public void CacheIsCleared()
        {
            var fileProviderTest = new LocalZipMapFileProviderTest();
            var dataProviderTest = new DefaultDataProviderTest();

            fileProviderTest.Initialize(dataProviderTest);

            fileProviderTest.Get(QuantConnect.Market.USA);
            Assert.AreEqual(1, dataProviderTest.FetchCount);
            Thread.Sleep(50);
            fileProviderTest.Get(QuantConnect.Market.USA);
            Assert.AreEqual(1, dataProviderTest.FetchCount);

            Thread.Sleep(1000);

            fileProviderTest.Get(QuantConnect.Market.USA);
            Assert.AreEqual(2, dataProviderTest.FetchCount);

            fileProviderTest.Enabled = false;
            dataProviderTest.DisposeSafely();
        }
예제 #4
0
        public void CacheIsCleared()
        {
            var fileProviderTest = new LocalZipMapFileProviderTest();
            var dataProviderTest = new DefaultDataProviderTest();

            fileProviderTest.Initialize(dataProviderTest);
            fileProviderTest.CacheCleared.Reset();

            fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);
            Assert.AreEqual(1, dataProviderTest.FetchCount);
            Thread.Sleep(50);
            fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);
            Assert.AreEqual(1, dataProviderTest.FetchCount);

            fileProviderTest.CacheCleared.WaitOne(TimeSpan.FromSeconds(2));
            fileProviderTest.Get(AuxiliaryDataKey.EquityUsa);
            Assert.AreEqual(2, dataProviderTest.FetchCount);

            fileProviderTest.Enabled = false;
            dataProviderTest.DisposeSafely();
        }
예제 #5
0
        public void CacheIsCleared()
        {
            var fileProviderTest = new LocalZipFactorFileProviderTest();
            var dataProviderTest = new DefaultDataProviderTest();

            fileProviderTest.Initialize(TestGlobals.MapFileProvider, dataProviderTest);

            fileProviderTest.Get(Symbols.AAPL);
            Assert.AreEqual(1, dataProviderTest.FetchCount);
            Thread.Sleep(50);
            fileProviderTest.Get(Symbols.AAPL);
            Assert.AreEqual(1, dataProviderTest.FetchCount);

            Thread.Sleep(1000);

            fileProviderTest.Get(Symbols.AAPL);
            Assert.AreEqual(2, dataProviderTest.FetchCount);

            fileProviderTest.Enabled = false;
            dataProviderTest.DisposeSafely();
        }