Exemplo n.º 1
0
        public void ShouldAssignInlineTemplate()
        {
            DataTemplate template = new DataTemplate();
              Editor editor = new TypeEditor(typeof(string), template);

              Assert.AreEqual(template, editor.InlineTemplate);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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)));
        }
Exemplo n.º 6
0
 public void ValidatesNotSupportedTemplateValues()
 {
     Editor editor = new TypeEditor(typeof(string), "WRONG_VALUE");
 }
Exemplo n.º 7
0
        public void ShouldAssignEditedType()
        {
            TypeEditor editor = new TypeEditor(typeof(string));

              Assert.AreEqual<Type>(typeof(string), editor.EditedType);
        }