public void ShouldNotReturnTemplateForEntryWithoutEditor() { GridEntryContainerMock container = new GridEntryContainerMock { Entry = new GridEntryMock() }; Assert.IsNull(container.EditorTemplate); }
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)); }
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); }
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); }
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); }