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(); }
public IEnumerable <Product> GetAll() { return(_getProductsQuery.Run()); }