コード例 #1
0
        public void it_should_tell_registered_graphs_to_engage_themselves()
        {
            var mockRegisteredGraph = MockRepository.GenerateMock<RegisteredGraph<DummyPersistentObject>>((Registry)null);
            var fakeBackingStore = MockRepository.GenerateStub<IBackingStore>();
            var sut = new Registry(fakeBackingStore);
            sut.RegisteredGraphs.Add(typeof(DummyPersistentObject), mockRegisteredGraph);

            sut.EngageBackingStore();

            mockRegisteredGraph.AssertWasCalled(graph => graph.EngageBackingStore(fakeBackingStore));
        }
コード例 #2
0
        public void it_should_tell_registered_indexers_to_engage_themselves()
        {
            var sut = new Registry(null);
            var mockRegisteredIndexer =
                MockRepository.GenerateMock<RegisteredIndexer<DummyPersistentObject, int>>((IIndex<DummyPersistentObject, int>)null, (IRegistry)null);
            sut.RegisteredIndexers.Add(mockRegisteredIndexer);

            sut.EngageBackingStore();

            mockRegisteredIndexer.AssertWasCalled(indexer => indexer.EngageBackingStore(null), options => options.IgnoreArguments());
        }