public async Task GetAllDelivered_ReturnsCorectly()
        {
            MapperInitializer.InitializeMapper();
            var context         = ApplicationDbContextInMemoryFactory.InitializeContext();
            var orderRepository = new EfDeletableEntityRepository <Order>(context);
            var orderService    = this.GetOrderService(orderRepository, context);
            var orderTestSeeder = new OrderTestSeeder();

            await orderTestSeeder.SeedOneDeliveredOrder(context);

            var result = orderService.GetAllDelivered <OrderProcessedViewModel>();

            Assert.Single(result);
        }
        public async Task Delete_WorksCorectly()
        {
            var context         = ApplicationDbContextInMemoryFactory.InitializeContext();
            var orderRepository = new EfDeletableEntityRepository <Order>(context);
            var orderService    = this.GetOrderService(orderRepository, context);
            var orderTestSeeder = new OrderTestSeeder();

            await orderTestSeeder.SeedOneUnprocessedOrder(context);

            var unProcessed = context.Orders.First(x => x.Recipient == "UnProcessed");

            await orderTestSeeder.SeedOneProcessedOrder(context);

            var processed = context.Orders.First(x => x.Recipient == "Processed");

            await orderTestSeeder.SeedOneDeliveredOrder(context);

            var delivered = context.Orders.First(x => x.Recipient == "Delivered");


            await orderService.Delete(unProcessed.Id);

            await orderService.Delete(processed.Id);

            await orderService.Delete(delivered.Id);

            var orders = context.Orders.Count();

            Assert.True(delivered.IsDeleted);

            Assert.Equal(0, orders);

            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                await orderService.Delete("invalid");
            });
        }