Example #1
0
        public void ShouldAllowSettingCategoryName()
        {
            CategoryEditor editor = new CategoryEditor();
              editor.CategoryName = "category";

              Assert.AreEqual<string>("category", editor.CategoryName);
        }
Example #2
0
        public void ShouldAllowSettingDeclaringType()
        {
            CategoryEditor editor = new CategoryEditor();
              editor.DeclaringType = typeof(string);

              Assert.AreEqual<Type>(typeof(string), editor.DeclaringType);
        }
Example #3
0
        public void ShouldFindCategoryEditor()
        {
            EditorCollection editors = new EditorCollection();
              CategoryEditor editor = new CategoryEditor(typeof(int), "category", new DataTemplate());
              editors.Add(editor);

              Assert.AreEqual<CategoryEditor>(editor, editors.FindCategoryEditor(typeof(int), "category"));
        }
Example #4
0
        public void ShouldInitilizePropertiesFromConstructor()
        {
            DataTemplate template = new DataTemplate();
              CategoryEditor editor = new CategoryEditor(typeof(string), "category", template);

              Assert.AreEqual<Type>(typeof(string), editor.DeclaringType);
              Assert.AreEqual<string>("category", editor.CategoryName);
              Assert.AreEqual(template, editor.InlineTemplate);
        }