Skip to content

Commit

Permalink
Add test for frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
Eskils committed Aug 30, 2024
1 parent 95ad9ca commit 1258104
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/unit-tests/TimeSeries/CumulativeReturn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
);
}

0 comments on commit 1258104

Please sign in to comment.