Exemplo n.º 1
0
        public void ImportMonthlyReturnsFileShouldInsertCorrectNumberOfSeriesWhenGivenValidFile()
        {
            DeleteTestData();

            ImportTestFile(GetNetReturnsTestFilePath());

            var series = _returnsSeriesDataRepository.GetReturnSeries(
                new[] { 100, 101, 102 });

            Assert.Equal(series.Length, 3);

            DeleteTestData();
        }
Exemplo n.º 2
0
        public void ShouldReadAndWriteReturnSeries()
        {
            var newReturnsSeries = InsertTestReturnSeries();

            var savedReturnSeries = _returnsSeriesDataRepository.GetReturnSeries(newReturnsSeries.ReturnSeriesId);

            AssertReturnSeriesRecordIsValid(savedReturnSeries, newReturnsSeries);

            _returnsSeriesDataRepository.DeleteReturnSeries(newReturnsSeries.ReturnSeriesId);
        }
Exemplo n.º 3
0
        private ReturnSeriesDto[] GetReturnSeriesDtos(
            InvestmentVehicleDto[] investmentVehicleDtos)
        {
            var distinctEntityNumbers = investmentVehicleDtos
                                        .Select(d => d.InvestmentVehicleNumber)
                                        .Distinct()
                                        .ToArray();

            var returnSeriesDtos = _returnsSeriesDataRepository
                                   .GetReturnSeries(distinctEntityNumbers);

            return(returnSeriesDtos);
        }