コード例 #1
0
        public void ComponentId()
        {
            IComponentPresentation cp    = ComponentPresentationFactory.GetComponentPresentation("", "componentlink");
            TestViewModelA         model = ViewModelFactory.BuildViewModel(cp) as TestViewModelA;

            Assert.IsNotNull(model.Id, "ComponentId is not set");
        }
コード例 #2
0
        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);
        }