public void Constructor()
        {
            TaxonCategory taxonCategory;

            taxonCategory = new TaxonCategory();
            Assert.IsNotNull(taxonCategory);
        }
 private TaxonCategory GetTaxonCategory(Boolean refresh)
 {
     if (_taxonCategory.IsNull() || refresh)
     {
         _taxonCategory = (TaxonCategory)(CoreData.TaxonManager.GetTaxonCategories(GetUserContext())[20]);
     }
     return(_taxonCategory);
 }
        public static TaxonCategory GetTaxonCategory(IUserContext userContext)
        {
            TaxonCategory taxonCategory;

            taxonCategory                = new TaxonCategory();
            taxonCategory.DataContext    = new DataContext(userContext);
            taxonCategory.Id             = Int32.MinValue;
            taxonCategory.IsMainCategory = false;
            taxonCategory.IsTaxonomic    = false;
            taxonCategory.Name           = String.Empty;
            taxonCategory.ParentId       = Int32.MinValue;
            taxonCategory.SortOrder      = Int32.MinValue;
            return(taxonCategory);
        }
示例#4
0
        /// <summary>
        /// Create a taxon category for test.
        /// </summary>
        /// <returns></returns>
        public ITaxonCategory GetReferenceTaxonCategory(IUserContext userContext, int i = 0)
        {
            ITaxonCategory refTaxonCategory = new TaxonCategory();
            // First we create a taxon category that we later use...
            string categoryName   = "Svenskt" + i;
            Int32  parentCategory = 2 + i;
            Int32  sortOrder      = 20 + i;
            bool   mainCategory   = true;
            bool   taxonomic      = true;
            Int32  categoryId     = 17 + i;

            refTaxonCategory.Name           = categoryName;
            refTaxonCategory.DataContext    = new DataContext(userContext);
            refTaxonCategory.Id             = categoryId;
            refTaxonCategory.IsMainCategory = mainCategory;
            refTaxonCategory.ParentId       = parentCategory;
            refTaxonCategory.SortOrder      = sortOrder;
            refTaxonCategory.IsTaxonomic    = taxonomic;


            return(refTaxonCategory);
        }
 public TaxonCategoryTest()
 {
     _taxonCategory = null;
 }