예제 #1
0
        public override void SetUp()
        {
            base.SetUp();

            IPersister persister = mocks.Stub<IPersister>();
            Expect.Call(delegate { persister.Save(null); })
                .IgnoreArguments()
                .Do(new Action<ContentItem>(savedItems.Add))
                .Repeat.Any();

            IEditManager editManager = mocks.Stub<IEditManager>();
            Expect.Call(editManager.GetEditorFilter(null))
                .IgnoreArguments()
                .Return(new PageFilter());

            IWebContext webContext = mocks.Stub<IWebContext>();

            mocks.ReplayAll();

            root = CreateOneItem<NormalPage>(1, "root", null);
            page1 = CreateOneItem<NormalPage>(2, "page1", root);
            item2 = CreateOneItem<NormalItem>(3, "item2", root);
            page3 = CreateOneItem<NormalPage>(4, "page3", root);
            item4 = CreateOneItem<NormalItem>(5, "item4", root);
            page5 = CreateOneItem<NormalPage>(6, "page5", root);
            N2.Utility.UpdateSortOrder(root.Children);

            sorter = new TreeSorter(persister, editManager, webContext);
        }
		public override void SetUp()
		{
			base.SetUp();

			persister = TestSupport.SetupFakePersister();
			var webContext = new ThreadContext();

			IEditManager editManager = mocks.Stub<IEditManager>();
			Expect.Call(editManager.GetEditorFilter(null))
				.IgnoreArguments()
				.Return(new PageFilter());
			mocks.ReplayAll();

			root = CreateOneItem<NormalPage>(1, "root", null);
			page1 = CreateOneItem<NormalPage>(2, "page1", root);
			item2 = CreateOneItem<NormalItem>(3, "item2", root);
			page3 = CreateOneItem<NormalPage>(4, "page3", root);
			item4 = CreateOneItem<NormalItem>(5, "item4", root);
			page5 = CreateOneItem<NormalPage>(6, "page5", root);
			N2.Utility.UpdateSortOrder(root.Children);
			
			sorter = new TreeSorter(persister, editManager, webContext, null);
		}