public void CreateOrder_should_not_execute_more_than_one_query()
        {
            Customer customer;
            using (var session = new SessionProvider().GetSession())
            using (var transaction = session.BeginTransaction())
            {
                customer = new Customer
                {
                    Name = Guid.NewGuid().ToString(),
                };
                session.Save(customer);
                transaction.Commit();
            }

            using (var session = new SessionProvider().GetSession())
            using (var transaction = session.BeginTransaction())
            {
                var makeOrder = new MakeOrder(session);
                var makeOrderCommand = new MakeOrderCommand
                {
                    CustomerId = customer.Id,
                    Description = Guid.NewGuid().ToString(),
                    Price = 20
                };

                using (3.Queries())
                {
                    makeOrder.Handle(makeOrderCommand);
                    transaction.Commit();
                }
            }
        }
        public static void PopulateDb()
        {
            using (var session = new SessionProvider().GetSession())
            using (var transaction = session.BeginTransaction())
            {
                var countries = new List<string> { "Belgie", "Nederland", "Luxemburg" };
                var random = new Random();
                for (var i = 1; i <= 10; i++)
                {
                    var customer = new Customer
                    {
                        Name = "Customer " + i,
                        BillingAddress = new Address
                        {
                            Street = "Billing Street " + i,
                            City = "Billing City " + i,
                            Country = countries.ElementAt(random.Next(0, countries.Count - 1))
                        },
                        ShippingAddress = new Address
                        {
                            Street = "Shipping Street " + i,
                            City = "Shipping City " + i,
                            Country = "Shipping Country " + i
                        },
                        LegalAddress = new Address
                        {
                            Street = "Legal Street " + i,
                            City = "Legal City " + i,
                            Country = "Legal Country " + i
                        }
                    };

                    var numberOfOrdersToGenerate = random.Next(2, 10);
                    for (var o = 1; o < numberOfOrdersToGenerate; o++)
                    {
                        customer.MakeOrder(Guid.NewGuid().ToString(), random.Next(10, 50));
                    }

                    session.Save(customer);
                }

                transaction.Commit();
            }
        }