Ejemplo n.º 1
0
        public void GetAllProducts_listProductsDto()
        {
            _parser = new Mock <IScraper>();
            _parser.Setup(a => a.ParsePcShop()).Returns(new List <ProductDTO>());

            _mapper = new Mock <IMapper>();
            _mapper.Setup(a => a.MapProductsToProductsDTO(new List <Product>())).Returns(new List <ProductDTO>());

            _uow = new Mock <IUnitOfWork>();
            _uow.Setup(a => a.Products.GetAll()).Returns(new List <Product>());

            ParserService parserService = new ParserService(_uow.Object, _parser.Object, _mapper.Object);

            List <ProductDTO> result = parserService.GetAllProducts();

            Assert.IsNotNull(result);
        }