예제 #1
0
        public void ShouldAssignInlineTemplate()
        {
            DataTemplate template = new DataTemplate();
              Editor editor = new TypeEditor(typeof(string), template);

              Assert.AreEqual(template, editor.InlineTemplate);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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)));
        }
예제 #6
0
 public void ValidatesNotSupportedTemplateValues()
 {
     Editor editor = new TypeEditor(typeof(string), "WRONG_VALUE");
 }
예제 #7
0
        public void ShouldAssignEditedType()
        {
            TypeEditor editor = new TypeEditor(typeof(string));

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