b6171cc9d5
Refactored IDataProvider interface to return stream. The IDataProvider Fetch method now only takes a key. The IDataProvider has been reshuffled to be at the bottom of the LeanDataStack. It provides data to the rest of the Lean stack. The default implementation of IDataProvider reads data from disc. All IDataCacheProviders now have constructors which take IDataProviders and use them to find data on disc. Renamed DataCacheProvider to ZipDataCacheProvider Added comments to IDataProvider and it's implementations Added comments to IDataCacheProvider and it's implementations
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using NUnit.Framework;
|
|
using QuantConnect.Lean.Engine.DataFeeds;
|
|
|
|
namespace QuantConnect.Tests.Engine.DataProviders
|
|
{
|
|
[TestFixture]
|
|
public class DefaultDataProviderTests
|
|
{
|
|
private DefaultDataProvider _defaultDataProvider;
|
|
|
|
[TestFixtureSetUp]
|
|
public void Setup()
|
|
{
|
|
_defaultDataProvider = new DefaultDataProvider();
|
|
}
|
|
|
|
[Test]
|
|
public void DefaultDataProvider_CanReadDataThatExists()
|
|
{
|
|
var stream = _defaultDataProvider.Fetch("../../../Data/equity/usa/minute/aapl/20140606_trade.zip");
|
|
|
|
Assert.IsNotNull(stream);
|
|
}
|
|
|
|
[Test]
|
|
public void DefaultDataProvider_CannotReadDataThatDoesNotExist()
|
|
{
|
|
var stream = _defaultDataProvider.Fetch("../../../Data/equity/usa/minute/aapl/19980606_trade.zip");
|
|
|
|
Assert.IsNull(stream);
|
|
}
|
|
}
|
|
}
|