public void Initialize() { // Setup unitOfWorkMock = new Mock <IUnitOfWork>(); customersRepository = new CustomersTestRepository(); unitOfWorkMock.Setup(s => s.CreateGenericRepository <Customer>()) .Returns(() => customersRepository); sut = new CustomersService(unitOfWorkMock.Object); }
public void Initialize() { // Setup unitOfWorkMock = new Mock <IUnitOfWork>(); siteRepository = new DefaultTestRepository <Site>(); organizationRepository = new DefaultTestRepository <Organization>(); categoriesOfCareRepository = new DefaultTestRepository <CategoryOfCare>(); customersRepository = new CustomersTestRepository(); unitOfWorkMock.Setup(s => s.CreateGenericRepository <Site>()) .Returns(() => siteRepository); unitOfWorkMock.Setup(s => s.CreateGenericRepository <Organization>()) .Returns(() => organizationRepository); unitOfWorkMock.Setup(s => s.CreateGenericRepository <Customer>()) .Returns(() => customersRepository); unitOfWorkMock.Setup(s => s.CreateGenericRepository <CategoryOfCare>()) .Returns(() => categoriesOfCareRepository); sut = new SitesService(unitOfWorkMock.Object); }