public List <BillOfExchangeDetailDto> GetByDrawer(int drawerId)
        {
            List <BillOfExchange> list = BillOfExchangeRepository.GetByDrawerIds(new List <int> {
                drawerId
            }).FirstOrDefault()?.ToList() ?? new List <BillOfExchange>();
            Dictionary <int, string> names = GetPartiesDictionary(GetPartiesIds(list));

            return(list.ConvertAll(b => new BillOfExchangeDetailDto(b.Id, b.DrawerId, names[b.DrawerId], b.BeneficiaryId, names[b.BeneficiaryId], b.Amount)));
        }
Пример #2
0
        public void BillOfExchangeRepository_GetByDrawerIds()
        {
            BillOfExchangeRepository sut = new BillOfExchangeRepository();

            IReadOnlyList <IEnumerable <BillOfExchange> > result = sut.GetByDrawerIds(new int[] { 14, 9 });

            Assert.Multiple(() =>
            {
                Assert.AreEqual(1, result.First().Count());
                Assert.AreEqual(2, result.Last().Count());
            });
        }