Ejemplo n.º 1
0
        public async Task Handle_ReturnsCorrectListCount()
        {
            var query = new GetAlleKeukenBestellingenQuery();

            var handler = new GetAlleKeukenBestellingenQuery.GetKitchenQueryHandler(_context);

            var result = await handler.Handle(query, CancellationToken.None);

            var list = result.Count;

            Assert.Equal(1, list);
        }
Ejemplo n.º 2
0
            public async Task <List <KeukenVm> > Handle(GetAlleKeukenBestellingenQuery request, CancellationToken cancellationToken)
            {
                var alleOrders =
                    await _context.Bestellingen
                    .Include(x => x.BesteldeProducten)
                    .ThenInclude(x => x.Product)
                    .Where(x => x.KeukenAfgerond == false)
                    .ToListAsync(cancellationToken);


                var test =
                    _context.Bestellingen
                    .Where(x => x.KeukenAfgerond == false)
                    .Include(x => x.BesteldeProducten)
                    .ThenInclude(x => x.Product)
                    .ToList();
                var burgersPerOrder = FilterAlleenBurgersPerOrder(alleOrders);

                return(burgersPerOrder);
            }