public void Initialize()
        {
            _creativeRepository = new Mock<IRepository<Creative, PersistCreative>>();
            _creativeRepository.Setup(repo => repo.GetAll()).Returns(GetAll());
            _creativeRepository.Setup(repo => repo.SearchById(It.IsAny<int>())).Returns(SearchById());

            var uow = new Mock<IUnitOfWork<Creative, PersistCreative>>();
            uow.SetupGet<IRepository<Creative, PersistCreative>>(u => u.Repository).Returns(_creativeRepository.Object);

            _creativeService = new CreativesService(uow.Object);
        }
예제 #2
0
        public void Initialize()
        {
            _creativeRepository = new Mock <IRepository <Creative, PersistCreative> >();
            _creativeRepository.Setup(repo => repo.GetAll()).Returns(GetAll());
            _creativeRepository.Setup(repo => repo.SearchById(It.IsAny <int>())).Returns(SearchById());

            var uow = new Mock <IUnitOfWork <Creative, PersistCreative> >();

            uow.SetupGet <IRepository <Creative, PersistCreative> >(u => u.Repository).Returns(_creativeRepository.Object);

            _creativeService = new CreativesService(uow.Object);
        }