public void SetUp() { _mapper = UnitTestsHelper.CreateMapperProfile(); categoryEntities = _mapper.Map <List <ProductCategoryEntity> >(expectedfullList); mockUOF = new Mock <IUnitOfWork>(); mockUOF.Setup(x => x.ProductCategoryRepository.GetAll()).Returns(categoryEntities); categoryService = new CategoryService(mockUOF.Object, _mapper); }
public void SetUp() { _mapper = UnitTestsHelper.CreateMapperProfile(); shopEntities = _mapper.Map <List <ShopEntity> >(expectedfullList); mockUOF = new Mock <IUnitOfWork>(); mockUOF.Setup(x => x.ShopRepository.GetAll()).Returns(shopEntities); shopService = new ShopService(mockUOF.Object, _mapper); }
public void SetUp() { _mapper = UnitTestsHelper.CreateMapperProfile(); entities = _mapper.Map <List <CartOrderItemEntity> >(expectedfullList); stockentity = _mapper.Map <StockEntity>(s); cartorderitementity = _mapper.Map <CartOrderItemEntity>(c); mockUOF = new Mock <IUnitOfWork>(); mockUOF.Setup(x => x.CartOrderItemRepository.GetAll()) .Returns(entities); mockUOF.Setup(x => x.CartOrderItemRepository.Get(cartorderitementity.Id)) .Returns(cartorderitementity); mockUOF.Setup(x => x.StockRepository.Get(stockentity.Id)) .Returns(stockentity); cartService = new CartService(mockUOF.Object, _mapper); }