Ejemplo n.º 1
0
        protected virtual IPersister CreatePersister()
        {
            persister  = TestSupport.SetupFakePersister();
            repository = (FakeContentItemRepository)persister.Repository;

            return(persister);
        }
Ejemplo n.º 2
0
        public static ContentPersister SetupFakePersister(out FakeContentItemRepository repository)
        {
            repository = new Fakes.FakeContentItemRepository();

            var sources = SetupContentSource(repository);

            return(new ContentPersister(sources, repository));
        }
Ejemplo n.º 3
0
        public virtual void SetUp()
        {
            repository = new FakeContentItemRepository();
            mocks      = new MockRepository();

            root  = CreateItem <ThrowableItem>(1, "root", null);
            item  = CreateItem <ThrowableItem>(2, "item", root);
            trash = CreateItem <TrashContainerItem>(3, "Trash", root);

            webContext = new ThreadContext();
            host       = new Host(webContext, 1, 1);
        }
Ejemplo n.º 4
0
        private void CreatePersister()
        {
            mocks.Record();
            persister = mocks.DynamicMock <IPersister>();

            repository = new FakeContentItemRepository();

            persister.Expect(p => p.Repository).Return(repository);

            persister.ItemMoving += null;
            moving = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser();

            persister.ItemCopying += null;
            copying = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser();

            persister.ItemDeleting += null;
            deleting = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser();

            persister.ItemSaving += null;
            saving = LastCall.IgnoreArguments().Repeat.Any().GetEventRaiser();

            mocks.Replay(persister);
        }
Ejemplo n.º 5
0
 public FakeVersionManager(FakeContentItemRepository itemRepository, StateChanger stateChanger, params Type[] definitionTypes)
     : base(TestSupport.CreateVersionRepository(definitionTypes), itemRepository, stateChanger, new N2.Configuration.EditSection())
 {
     this.itemRepository = itemRepository;
 }