From 3202f0c8e76d1f5a6903d4f48a9f5f7e863a41fd Mon Sep 17 00:00:00 2001 From: Eskil Gjerde Sviggum Date: Fri, 30 Aug 2024 13:12:42 +0200 Subject: [PATCH] Add test for frequency --- .../TimeSeries/CumulativeReturn.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/unit-tests/TimeSeries/CumulativeReturn.test.ts b/test/unit-tests/TimeSeries/CumulativeReturn.test.ts index d9eba8c..c6204d5 100644 --- a/test/unit-tests/TimeSeries/CumulativeReturn.test.ts +++ b/test/unit-tests/TimeSeries/CumulativeReturn.test.ts @@ -44,3 +44,30 @@ export async function cumulativeReturnLoad ( ); } + +export async function cumulativeReturnLoadWithFrequency ( + api: MC.Shared.MorningstarAPIOptions +) { + const connector = new MC.TimeSeriesConnector({ + api, + currencyId: 'EUR', + endDate: '2020-12-31', + frequency: 'weekly', + securities: [{ + id: 'F0GBR04S23', + idType: 'MSID' + }], + series: { + type: 'CumulativeReturn' + }, + startDate: '2020-01-01' + }); + + await connector.load(); + + Assert.strictEqual( + connector.table.getRowCount(), + 52, + 'Connector table should have 52 cumulative return rows when frequency is weekly.' + ); +}