public void TestRetriveStockNames() { //Get a Taxon that has stock names. BO.Taxonomy.BOTaxon AnimalKingdom = BO.Taxonomy.TaxonomySearch.GetAnimalKingdom(); BO.Taxonomy.BOTaxon Parent = GetTaxonDescendant(AnimalKingdom, BO.Taxonomy.TaxonTypeEnum.Species, new CustomConditionDelegate(CustomConditionGetTaxonHavingStock)); BO.Taxonomy.BOTaxon [] StockTaxa = Parent.GetStockNames(); Assert.IsTrue(StockTaxa.Length > 0); foreach (BO.Taxonomy.BOTaxon Stock in StockTaxa) { Assert.IsTrue(Stock.TaxonType == BO.Taxonomy.TaxonTypeEnum.Stock); } }
protected static BO.Taxonomy.BOTaxon CustomConditionGetTaxonHavingStock(BO.Taxonomy.BOTaxon Taxon, object[] Taxa) { BO.Taxonomy.BOTaxon [] Stocks = Taxon.GetStockNames(); if (Stocks.Length > 0) { return(Taxon); } else { return(null); } }