public void SetUp() { persister = new ContentPersister(new Fakes.FakeRepository <ContentItem>(), new Fakes.FakeRepository <ContentDetail>()); persister.Save(page = new Items.PageItem { ID = 1 }); persister.Save(item = new Items.DataItem { ID = 2 }); }
public void SetUp() { persister = TestSupport.SetupFakePersister(); persister.Save(page = new Items.PageItem { ID = 1 }); persister.Save(item = new Items.DataItem { ID = 2 }); }
public void Url_ToItem_ThatIsVersion_IsTheUrl_OfTheMasterVersion_PlusVersionIndex() { CreateDefaultStructure(); var version = new PageItem { VersionIndex = 1, VersionOf = page1_1 }; string itemUrl = parser.BuildUrl(page1_1); string url = parser.BuildUrl(version); itemUrl.ShouldBe("/item1_1.aspx"); url.ShouldBe("/item1_1.aspx?versionIndex=1"); }
protected void CreateDefaultStructure() { startItem = CreateOneItem<PageItem>(1, "root", null); item1 = CreateOneItem<PageItem>(2, "item1", startItem); item1_1 = CreateOneItem<PageItem>(3, "item1_1", item1); item2 = CreateOneItem<PageItem>(4, "item2", startItem); item2_1 = CreateOneItem<PageItem>(5, "item2_1", item2); data1 = CreateOneItem<DataItem>(6, "data1", startItem); data2 = CreateOneItem<DataItem>(7, "data2", item2); data3 = CreateOneItem<DataItem>(8, "data3", item2_1); }
public void SetUp() { persister = new ContentPersister(new Fakes.FakeRepository<ContentItem>(), new Fakes.FakeRepository<ContentDetail>()); persister.Save(page = new Items.PageItem { ID = 1 }); persister.Save(item = new Items.DataItem { ID = 2 }); }
//[Test] //public void CanResolve_DefaultRequestController() //{ // SetUrl("/"); // RequestAdapter adapter = dispatcher.ResolveAdapter<RequestAdapter>(); // Assert.That(adapter, Is.TypeOf(typeof(RequestAdapter))); //} //[Test] //public void CanResolve_CustomController() //{ // SetUrl("/custom3.aspx"); // RequestAdapter adapter = dispatcher.ResolveAdapter<RequestAdapter>(); // Assert.That(adapter, Is.TypeOf(typeof(CustomRequestAdapter))); //} //[Test] //public void CanResolve_CustomController_OnInheritedItem() //{ // SetUrl("/particular4.aspx"); // RequestAdapter adapter = dispatcher.ResolveAdapter<RequestAdapter>(); // Assert.That(adapter, Is.TypeOf(typeof(CustomRequestAdapter))); //} //[Test] //public void CanResolve_CustomController_WithRedefinedController() //{ // SetUrl("/special5.aspx"); // RequestAdapter adapter = dispatcher.ResolveAdapter<RequestAdapter>(); // Assert.That(adapter, Is.TypeOf(typeof(SpecialCustomAdapter))); //} //[Test] //public void CanResolve_CustomController_WithOtherController() //{ // SetUrl("/other6.aspx"); // RequestAdapter adapter = dispatcher.ResolveAdapter<RequestAdapter>(); // Assert.That(adapter, Is.TypeOf(typeof(OtherCustomController))); //} protected void CreateDefaultStructure() { startItem = CreateOneItem<PageItem>(1, "root", null); item1 = CreateOneItem<PageItem>(2, "item1", startItem); item1_1 = CreateOneItem<PageItem>(3, "item1_1", item1); item2 = CreateOneItem<PageItem>(4, "item2", startItem); item2_1 = CreateOneItem<PageItem>(5, "item2_1", item2); custom3 = CreateOneItem<CustomItem>(6, "custom3", startItem); particular4 = CreateOneItem<ParticularCustomItem>(7, "particular4", startItem); special5 = CreateOneItem<SpecialCustomItem>(8, "special5", startItem); other6 = CreateOneItem<OtherCustomItem>(9, "other6", startItem); }