public void Nifty50HistoryShouldExactCountAsExpected() { var start = new DateTime(2017, 04, 01); var end = start.AddDays(364); var requestInformation = new RequestForIndexInformation(Index.Nifty50, start, end); var history = new History(requestInformation).Get(); Assert.Equal(246, history.Count); }
public void NiftyAaaCorporateBondHistoryShouldQueryDirectInCaseOfLessThanConfigurationPeriod() { var start = new DateTime(2017, 04, 01); var end = start.AddDays(50); var requestInformation = new RequestForIndexInformation(Index.NiftyAAACorporateBond, start, end); var history = new History(requestInformation).Get(); Assert.Equal(51, history.Count); }
public void RequestForIndexInformationShouldNotAcceptEndDateGreaterThanStartDate() { var start = new DateTime(2017, 04, 01); var end = start.AddDays(-364); Assert.Throws <ArgumentException>(() => { var requestForIndexInformation = new RequestForIndexInformation(Index.Nifty50, start, end); }); }
public History(RequestForIndexInformation requestForIndexInformation) { RequestForIndexInformation = requestForIndexInformation ?? throw new ArgumentNullException(nameof(requestForIndexInformation)); }