Esempio n. 1
0
        public void SetUp()
        {
            _mocker = new AutoMoqer();

            var customer = new CustomerModel
            {
                Id   = CustomerId,
                Name = CustomerName,
            };

            var employee = new EmployeeModel()
            {
                Id   = EmployeeId,
                Name = EmployeeName
            };

            var product = new ProductModel
            {
                Id        = ProductId,
                Name      = ProductName,
                UnitPrice = ProductPrice
            };

            _mocker.GetMock <IGetCustomersListQuery>()
            .Setup(p => p.Execute())
            .Returns(new List <CustomerModel> {
                customer
            });

            _mocker.GetMock <IGetEmployeesListQuery>()
            .Setup(p => p.Execute())
            .Returns(new List <EmployeeModel> {
                employee
            });

            _mocker.GetMock <IGetProductsListQuery>()
            .Setup(p => p.Execute())
            .Returns(new List <ProductModel> {
                product
            });

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

            var customer = new CustomerModel
            {
                Id = CustomerId,
                Name = CustomerName,
            };

            var employee = new EmployeeModel()
            {
                Id = EmployeeId,
                Name = EmployeeName
            };

            var product = new ProductModel
            {
                Id = ProductId,
                Name = ProductName,
                UnitPrice = ProductPrice
            };

            _mocker.GetMock<IGetCustomersListQuery>()
                .Setup(p => p.Execute())
                .Returns(new List<CustomerModel> { customer });

            _mocker.GetMock<IGetEmployeesListQuery>()
                .Setup(p => p.Execute())
                .Returns(new List<EmployeeModel> { employee });

            _mocker.GetMock<IGetProductsListQuery>()
                .Setup(p => p.Execute())
                .Returns(new List<ProductModel> { product });

            _factory = _mocker.Create<CreateSaleViewModelFactory>();
        }