public void SetUp() { _mocks = new MockRepository(); _mockedPrePersistenceStrategy = _mocks.StrictMock <IPrePersistenceStrategy <int> >(); _mockedPostPersistenceStrategy = _mocks.StrictMock <IPostPersistenceStrategy <int> >(); _mockedPostFetchStrategy = _mocks.StrictMock <IPostFetchStrategy <int> >(); }
public void WithPostPersistenceStrategyReturnsObjectItWasCalledOn() { IPostPersistenceStrategy <int> expectedStrategy = _mockedPostPersistenceStrategy; var repositoryStrategySet = new RepositoryStrategySet <int>(); var returnedStrategySet = repositoryStrategySet.WithPostPersistenceStrategy(expectedStrategy); Assert.AreSame(returnedStrategySet, returnedStrategySet); }
public void WithPostPersistenceStrategyAddsGivenStrategyToCollection() { IPostPersistenceStrategy <int> expectedStrategy = _mockedPostPersistenceStrategy; var repositoryStrategySet = new RepositoryStrategySet <int>(); repositoryStrategySet.WithPostPersistenceStrategy(expectedStrategy); Assert.AreEqual(expectedStrategy, repositoryStrategySet.PostPersistenceStrategies.Single(), "Given strategy not added to collection of PostPersistenceStrategies."); }
public RepositoryStrategySet <T> WithPostPersistenceStrategy(IPostPersistenceStrategy <T> postPersistenceStrategy) { return(AppendCollectionChain(PostPersistenceStrategies, postPersistenceStrategy)); }