public void ComponentId() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "componentlink"); TestViewModelA model = ViewModelFactory.BuildViewModel(cp) as TestViewModelA; Assert.IsNotNull(model.Id, "ComponentId is not set"); }
public void PageId() { IPage page = PageFactory.FindPage("/page-which-matches-a-model"); TestPageModel model = ViewModelFactory.BuildViewModel(page) as TestPageModel; Assert.IsNotNull(model.PageId, "PageId is not set"); }
public void MapConcreteLink() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "componentlink"); Assert.IsNotNull(cp); IViewModel vm = ViewModelFactory.BuildViewModel(cp); Assert.IsNotNull(vm); TestViewModelB b = ((TestViewModelA)vm).ConcreteLink[0]; Assert.IsNotNull(b); Assert.IsTrue(b.Heading == "some heading"); }
public void MapConcreteKeywordField() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "keyword"); Assert.IsNotNull(cp); KeywordContainingModel vm = ViewModelFactory.BuildViewModel(cp) as KeywordContainingModel; Assert.IsNotNull(vm); KeywordModel km = vm.ConcreteKeyword; Assert.IsNotNull(km); Assert.IsTrue(km.Heading == "some heading"); }
public void MapAbstractEmbeddedField() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "embedded"); Assert.IsNotNull(cp); EmbeddingModel vm = ViewModelFactory.BuildViewModel(cp) as EmbeddingModel; Assert.IsNotNull(vm); EmbeddedModel em = vm.Embedded as EmbeddedModel; Assert.IsNotNull(em); Assert.IsTrue(em.Heading == "some heading"); }
public void KeywordIdAsTcmUri() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "keyword"); Assert.IsNotNull(cp); KeywordContainingModel vm = ViewModelFactory.BuildViewModel(cp) as KeywordContainingModel; Assert.IsNotNull(vm); KeywordModel km = vm.ConcreteKeyword; Assert.IsNotNull(km); Assert.IsNotNull(km.KeywordId, "KeywordId is not set"); }
public void MapComponentId() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "componentId"); Assert.IsNotNull(cp); IViewModel vm = ViewModelFactory.BuildViewModel(cp); Assert.IsNotNull(vm); TestViewModelA b = (TestViewModelA)vm; Assert.IsNotNull(b); Assert.IsTrue(b.Id.ItemId == 8975); Assert.IsTrue(b.Id.PublicationId == 5); }
public void MapFieldsIgnoreCase() { IComponentPresentation cp = ComponentPresentationFactory.GetComponentPresentation("", "componentIgnoreCase"); Assert.IsNotNull(cp); //ViewModelFactory.LoadViewModels(); IViewModel vm = ViewModelFactory.BuildViewModel(cp); Assert.IsNotNull(vm); TestViewModelB b = ((TestViewModelA)vm).ConcreteLink[0]; Assert.IsNotNull(b); /// Assert.IsTrue(b.Heading == "some heading"); }