public void SetUp()
        {
            var customer = new Customer
            {
                Name = CustomerName
            };

            var employee = new Employee
            {
                Name = EmployeeName
            };

            var product = new Product
            {
                Name = ProductName
            };

            _sale = new Sale()
            {
                Id = SaleId,
                Date = Date,
                Customer = customer,
                Employee = employee,
                Product = product,
                UnitPrice = UnitPrice,
                Quantity = Quantity,
                TotalPrice = TotalPrice
            };

            _mocker = new AutoMoqer();

            _query = _mocker.Create<GetSalesListQuery>();
        }
        public void SetUp()
        {
            _mocker = new AutoMoqer();

            _product = new Product()
            {
                Id = Id,
                Name = Name
            };

            _mocker.GetMock<IDbSet<Product>>()
                .SetUpDbSet(new List<Product> { _product });

            _mocker.GetMock<IDatabaseContext>()
                .Setup(p => p.Products)
                .Returns(_mocker.GetMock<IDbSet<Product>>().Object);

            _query = _mocker.Create<GetProductsListQuery>();
        }
        public Sale Create(DateTime date, Customer customer, Employee employee, Product product, int quantity)
        {
            var sale = new Sale();

            sale.Date = date;

            sale.Customer = customer;

            sale.Employee = employee;

            sale.Product = product;

            sale.UnitPrice = sale.Product.Price;

            sale.Quantity = quantity;

            // Note: Total price is calculated in domain logic

            return sale;
        }