예제 #1
0
        public void WithPostPersistenceStrategyReturnsObjectItWasCalledOn()
        {
            IPostPersistenceStrategy <int> expectedStrategy = _mockedPostPersistenceStrategy;
            var repositoryStrategySet = new RepositoryStrategySet <int>();
            var returnedStrategySet   = repositoryStrategySet.WithPostPersistenceStrategy(expectedStrategy);

            Assert.AreSame(returnedStrategySet, returnedStrategySet);
        }
예제 #2
0
        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.");
        }
예제 #3
0
        public void WithPostPersistenceStrategyThrowsExceptionWhenNullStrategyGiven()
        {
            var repositoryStrategySet = new RepositoryStrategySet <int>();

            repositoryStrategySet.WithPostPersistenceStrategy(null);
        }