public void ShouldAssignInlineTemplate() { DataTemplate template = new DataTemplate(); Editor editor = new TypeEditor(typeof(string), template); Assert.AreEqual(template, editor.InlineTemplate); }
public void ShouldAssignInlineAndExtendedTemplates() { DataTemplate template1 = new DataTemplate(); DataTemplate template2 = new DataTemplate(); Editor editor = new TypeEditor(typeof(string), template1, template2); Assert.AreEqual(template1, editor.InlineTemplate); Assert.AreEqual(template2, editor.ExtendedTemplate); }
public void AcceptsResourceKeyForTemplates() { ComponentResourceKey key = new ComponentResourceKey(); Editor editor = new TypeEditor { InlineTemplate = key, ExtendedTemplate = key, DialogTemplate = key }; Assert.AreEqual(key, editor.InlineTemplate); Assert.AreEqual(key, editor.ExtendedTemplate); Assert.AreEqual(key, editor.DialogTemplate); }
public void AcceptsDataTemplateForTemplates() { DataTemplate template = new DataTemplate(); Editor editor = new TypeEditor { InlineTemplate = template, ExtendedTemplate = template, DialogTemplate = template }; Assert.AreEqual(template, editor.InlineTemplate); Assert.AreEqual(template, editor.ExtendedTemplate); Assert.AreEqual(template, editor.DialogTemplate); }
public void ShouldFindTypeEditorByTypeName() { EditorCollection editors = new EditorCollection(); TypeEditor editor = new TypeEditor(typeof(int), new DataTemplate()); editors.Add(editor); Assert.AreEqual<TypeEditor>(editor, editors.FindTypeEditor(typeof(int))); }
public void ValidatesNotSupportedTemplateValues() { Editor editor = new TypeEditor(typeof(string), "WRONG_VALUE"); }
public void ShouldAssignEditedType() { TypeEditor editor = new TypeEditor(typeof(string)); Assert.AreEqual<Type>(typeof(string), editor.EditedType); }