예제 #1
0
        public void ShouldNotReturnTemplateForEntryWithoutEditor()
        {
            GridEntryContainerMock container = new GridEntryContainerMock {
                Entry = new GridEntryMock()
            };

            Assert.IsNull(container.EditorTemplate);
        }
예제 #2
0
        public void ShouldResetParentContainerWithNull()
        {
            GridEntryContainerMock container = new GridEntryContainerMock();

            GridEntryContainer.SetParentContainer(container, container);
            Assert.AreEqual(container, GridEntryContainer.GetParentContainer(container));

            GridEntryContainer.SetParentContainer(container, null);
            Assert.IsNull(GridEntryContainer.GetParentContainer(container));
        }
예제 #3
0
        public void ShouldReturnEditorWithDataTemplate()
        {
            DataTemplate  template = new DataTemplate();
            GridEntryMock entry    = new GridEntryMock {
                Editor = new EditorMock {
                    InlineTemplate = template
                }
            };
            GridEntryContainerMock container = new GridEntryContainerMock {
                Entry = entry
            };

            Assert.AreEqual <DataTemplate>(template, container.EditorTemplate);
        }
예제 #4
0
        public void ShouldReturnNothingForWrongComponentKey()
        {
            ComponentResourceKey key             = new ComponentResourceKey();
            ResourceLocatorMock  resourceLocator = new ResourceLocatorMock(key, null);

            GridEntryMock entry = new GridEntryMock {
                Editor = new EditorMock {
                    InlineTemplate = key
                }
            };
            GridEntryContainerMock container = new GridEntryContainerMock(resourceLocator)
            {
                Entry = entry
            };

            Assert.IsNull(container.EditorTemplate);
        }
예제 #5
0
        public void ShouldReturnEditorWithComponentResourceKey()
        {
            ComponentResourceKey key      = new ComponentResourceKey();
            DataTemplate         template = new DataTemplate();

            ResourceLocatorMock resourceLocator = new ResourceLocatorMock(key, template);

            GridEntryMock entry = new GridEntryMock {
                Editor = new EditorMock {
                    InlineTemplate = key
                }
            };
            GridEntryContainerMock container = new GridEntryContainerMock(resourceLocator)
            {
                Entry = entry
            };

            Assert.AreEqual(template, container.EditorTemplate);
        }