protected virtual IPersister CreatePersister() { persister = TestSupport.SetupFakePersister(); repository = (FakeContentItemRepository)persister.Repository; return(persister); }
public static ContentPersister SetupFakePersister(out FakeContentItemRepository repository) { repository = new Fakes.FakeContentItemRepository(); var sources = SetupContentSource(repository); return(new ContentPersister(sources, repository)); }
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); }
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); }
public FakeVersionManager(FakeContentItemRepository itemRepository, StateChanger stateChanger, params Type[] definitionTypes) : base(TestSupport.CreateVersionRepository(definitionTypes), itemRepository, stateChanger, new N2.Configuration.EditSection()) { this.itemRepository = itemRepository; }