public void SetUp() { _mocks = new MockRepository(); _mockedPrePersistenceStrategy = _mocks.StrictMock <IPrePersistenceStrategy <int> >(); _mockedPostPersistenceStrategy = _mocks.StrictMock <IPostPersistenceStrategy <int> >(); _mockedPostFetchStrategy = _mocks.StrictMock <IPostFetchStrategy <int> >(); }
public void WithPostFetchStrategyReturnsObjectItWasCalledOn() { IPostFetchStrategy <int> expectedStrategy = _mockedPostFetchStrategy; var repositoryStrategySet = new RepositoryStrategySet <int>(); var returnedStrategySet = repositoryStrategySet.WithPostFetchStrategy(expectedStrategy); Assert.AreSame(returnedStrategySet, returnedStrategySet); }
public void WithPostFetchStrategyAddsGivenStrategyToCollection() { IPostFetchStrategy <int> expectedStrategy = _mockedPostFetchStrategy; var repositoryStrategySet = new RepositoryStrategySet <int>(); repositoryStrategySet.WithPostFetchStrategy(expectedStrategy); Assert.AreEqual(expectedStrategy, repositoryStrategySet.PostFetchStrategies.Single(), "Given strategy not added to collection of PostFetchStrategies."); }
public RepositoryStrategySet <T> WithPostFetchCollectionStrategy(IPostFetchStrategy <IEnumerable <T> > postFetchCollectionStrategy) { return(AppendCollectionChain(PostFetchCollectionStrategies, postFetchCollectionStrategy)); }