public void should_return_repository() { //arrange var repository = A.Fake <IRepository <TestEntity> >(); A.CallTo(() => SessionScope.CreateRepository <TestEntity>()).Returns(repository); //act UnitOfWork.Do(uow => { var result = uow.Repo <TestEntity>(); //assert result.Should().NotBeNull(); }); }
/// <summary> /// Get Repository object to perform queries/operations on database. /// </summary> public IRepository <TEntity> Repo <TEntity>() where TEntity : class { return(SessionScope.CreateRepository <TEntity>()); }