public void TestTradingTimeSaveLoad() { string path = TestCaseManager.GetTestCasePath(GetType(), "CsvUtils_TradingTime"); List <ITradingTime> TradingTime = CsvUtils_TradingTime.Load(path); string outputPath = TestCaseManager.GetTestCasePath(GetType(), "TradingTime_Output.csv"); CsvUtils_TradingTime.Save(outputPath, TradingTime); List <ITradingTime> newTradingTime = CsvUtils_TradingTime.Load(outputPath); AssertUtils.AssertEqual_List_ToString(TradingTime, newTradingTime); }
public void TestTradingDaySaveLoad() { string path = TestCaseManager.GetTestCasePath(GetType(), "CsvUtils_TradingDay"); List <int> tradingDay = CsvUtils_TradingDay.Load(path); string outputPath = TestCaseManager.GetTestCasePath(GetType(), "TradingDay_Output.csv"); CsvUtils_TradingDay.Save(outputPath, tradingDay); List <int> newTradingDay = CsvUtils_TradingDay.Load(outputPath); AssertUtils.AssertEqual_List_ToString(tradingDay, newTradingDay); }
private void TestTradingDaySaveLoad(string uri) { IDataStore dataStore = DataStoreFactory.CreateDataStore(uri); ITradingDayStore store = dataStore.CreateTradingDayStore(); List <int> codes = MockDataLoader.GetAllTradingDays(); store.Save(codes); List <int> codes2 = store.Load(); AssertUtils.AssertEqual_List_ToString(codes, codes2); store.Delete(); }
private void TestInstrumentsSaveLoad(string uri) { IDataStore dataStore = DataStoreFactory.CreateDataStore(uri); ICodeStore store = dataStore.CreateInstrumentStore(); List <CodeInfo> codes = MockDataLoader.GetAllInstruments(); store.Save(codes); List <CodeInfo> codes2 = store.Load(); AssertUtils.AssertEqual_List_ToString(codes, codes2); store.Delete(); }
public void TestInstrumentsSaveLoad() { String outputPath = TestCaseManager.GetTestCasePath(GetType(), "codes"); string instrumentPath = TestCaseManager.GetTestCasePath(GetType(), "Store_Code"); InstrumentStore_File store = new InstrumentStore_File(instrumentPath); List <CodeInfo> codes = store.Load(); InstrumentStore_File store2 = new InstrumentStore_File(outputPath); store2.Save(codes); List <CodeInfo> codes2 = store2.Load(); AssertUtils.AssertEqual_List_ToString(codes, codes2); File.Delete(outputPath); }
public void TestAccountFeeStore() { String outputPath = TestCaseManager.GetTestCasePath(GetType(), "accountfee"); string instrumentPath = TestCaseManager.GetTestCasePath(GetType(), "Store_AccountFee"); AccountFeeInfoStore_File store = new AccountFeeInfoStore_File(instrumentPath); List <AccountFeeInfo> codes = store.LoadAllAccountFee(); AccountFeeInfoStore_File store2 = new AccountFeeInfoStore_File(outputPath); store2.SaveAccountFee(codes); List <AccountFeeInfo> codes2 = store2.LoadAllAccountFee(); AssertUtils.AssertEqual_List_ToString(codes, codes2); File.Delete(outputPath); }
private void TestTradingSessionSaveLoad(string uri) { string code = "M05"; IDataStore dataStore = DataStoreFactory.CreateDataStore(uri); ITradingSessionStore store = dataStore.CreateTradingSessionStore(); try { List <TradingSession> codes = MockDataLoader.GetTradingSessions(code); store.Save(code, codes); List <TradingSession> codes2 = store.Load(code); AssertUtils.AssertEqual_List_ToString(codes, codes2); } finally { store.Delete(code); } }