public TRep InitializeRepository <TRep, TDo>(IEnumerable <TDo> all) where TRep : class, IRepository <TDo> { var inMemoryRepositoryMoq = createInMemoryRepositoryMock <TRep, TDo>(all); var concreteInMemoryRepository = inMemoryRepositoryMoq.As <TRep>().Object; UnitOfWorkMoq.Setup(_makeRepositoryGetter <TRep>()).Returns(concreteInMemoryRepository); return(concreteInMemoryRepository); }
public void SetRepository <TRep, TDo>(TRep repositoryInstace) where TRep : class, IRepository <TDo> { UnitOfWorkMoq.Setup(_makeRepositoryGetter <TRep>()).Returns(repositoryInstace); }