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>();
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            _mocker = new AutoMoqer();

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

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

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

            _query = _mocker.Create <GetProductsListQuery>();
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            _mocker = new AutoMoqer();

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

            _products = new List <Product>()
            {
                _product
            };

            _mocker.GetMock <IProductRepository>()
            .Setup(p => p.GetAll())
            .Returns(_products.AsQueryable());

            _query = _mocker.Create <GetProductsListQuery>();
        }