Ejemplo n.º 1
0
        public void GetAllShouldReturnAllProducts()
        {
            // Given
            var expectedProducts = new[] { Constants.Monitor, Constants.Notebook };

            A.CallTo(() => _getProductsQuery.Run()).Returns(expectedProducts);

            // When
            var products = _productController.GetAll();

            // Then
            Assert.Equal(expectedProducts, products);

            A.CallTo(() => _getProductsQuery.Run()).MustHaveHappened();
        }
        public void RunShouldReturnAllProducts()
        {
            // Given
            var expectedProducts = new[] { Constants.Monitor, Constants.Notebook };

            A.CallTo(() => _dapperService.List <Product>(A <string> .Ignored)).Returns(expectedProducts);

            // When
            var products = _getProductsQuery.Run();

            // Then
            Assert.Equal(expectedProducts, products);

            A.CallTo(() => _dapperService.List <Product>(A <string> .Ignored)).MustHaveHappened();
        }
Ejemplo n.º 3
0
 public IEnumerable <Product> GetAll()
 {
     return(_getProductsQuery.Run());
 }