public static List <WebSpeciesFact> GetSomeSpeciesFacts(WebServiceContext context) { WebUserParameterSelection userParameterSelection; userParameterSelection = new WebUserParameterSelection(); userParameterSelection.TaxonIds = TaxonManagerTest.GetSomeTaxonIds(); return(SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(context, userParameterSelection)); }
private WebUserParameterSelection GetUserParameterSelection(Boolean refresh) { if (_userParameterSelection.IsNull() || refresh) { _userParameterSelection = new WebUserParameterSelection(); } return(_userParameterSelection); }
public void GetSpeciesFactsByUserParameterSelectionToManyError() { List <WebSpeciesFact> speciesFacts; WebUserParameterSelection userParameterSelection; userParameterSelection = new WebUserParameterSelection(); speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); Assert.IsTrue(speciesFacts.IsNotEmpty()); }
private WebUserParameterSelection GetUserParameterSelection() { WebUserParameterSelection userParameterSelection; userParameterSelection = new WebUserParameterSelection(); userParameterSelection.FactorIds = new List <Int32>(); userParameterSelection.FactorIds.Add(FOREST_LANSCAPE_FACTOR_ID); userParameterSelection.FactorIds.Add(LANDSCAPE_FOREST_FACTOR_ID); userParameterSelection.TaxonIds = new List <Int32>(); userParameterSelection.TaxonIds.Add(BEAVER_TAXON_ID); userParameterSelection.TaxonIds.Add(BEAR_TAXON_ID); return(userParameterSelection); }
private static List <ArtDatabanken.Data.WebService.WebSpeciesFact> GetSpeciesFacts(WebServiceContext context, int FactorId) { List <ArtDatabanken.Data.WebService.WebSpeciesFact> webSpeciesFacts; WebUserParameterSelection webUserParameterSelection = new WebUserParameterSelection(); webUserParameterSelection.FactorIds = new List <Int32>(); webUserParameterSelection.FactorIds.Add(FactorId); webUserParameterSelection.IndividualCategoryIds = new List <Int32>(); try { IndividualCategory individualcategory = IndividualCategoryManager.GetDefaultIndividualCategory(); webUserParameterSelection.IndividualCategoryIds.Add(individualcategory.Id); } catch (Exception ex) { LogResult(context, "Failed calling ArtDatabankenService. WebServiceAddress: " + WebServiceClient.WebServiceAddress); LogResult(context, "Exception: " + ex.Message); } // Get data from web service. webSpeciesFacts = WebServiceClient.GetSpeciesFactsByUserParameterSelection(webUserParameterSelection); return(webSpeciesFacts); }
public WebUserParameterSelectionTest() { _userParameterSelection = null; }
public void GetSpeciesFactsByUserParameterSelection() { List <Int32> factorIds, hostIds, individualCategoryIds, periodIds, referenceIds, taxonIds; List <WebSpeciesFact> speciesFacts; WebUserParameterSelection userParameterSelection; Int32 speciesFactCount; userParameterSelection = new WebUserParameterSelection(); factorIds = FactorManagerTest.GetSomeFactorIds(); hostIds = TaxonManagerTest.GetSomeTaxonIds(); individualCategoryIds = IndividualCategoryManagerTest.GetSomeIndividualCategoryIds(GetContext()); individualCategoryIds.RemoveAt(0); periodIds = PeriodManagerTest.GetSomePeriodIds(GetContext()); periodIds.RemoveAt(periodIds.Count - 2); periodIds.RemoveAt(periodIds.Count - 2); referenceIds = ReferenceManagerTest.GetSomeReferenceIds(GetContext()); taxonIds = TaxonManagerTest.GetSomeTaxonIds(); userParameterSelection.TaxonIds = taxonIds; speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); Assert.IsTrue(speciesFacts.IsNotEmpty()); speciesFactCount = speciesFacts.Count; userParameterSelection.FactorIds = factorIds; speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); Assert.IsTrue(speciesFacts.IsNotEmpty()); Assert.IsTrue(speciesFactCount > speciesFacts.Count); userParameterSelection.FactorIds = null; userParameterSelection.IndividualCategoryIds = individualCategoryIds; speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); if (speciesFacts.IsNotEmpty()) { Assert.IsTrue(speciesFactCount > speciesFacts.Count); } userParameterSelection.IndividualCategoryIds = null; userParameterSelection.PeriodIds = periodIds; speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); if (speciesFacts.IsNotEmpty()) { Assert.IsTrue(speciesFactCount > speciesFacts.Count); } userParameterSelection.PeriodIds = null; userParameterSelection.HostIds = hostIds; speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); if (speciesFacts.IsNotEmpty()) { Assert.IsTrue(speciesFactCount > speciesFacts.Count); } userParameterSelection.HostIds = null; userParameterSelection.ReferenceIds = referenceIds; speciesFacts = SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(GetContext(), userParameterSelection); if (speciesFacts.IsNotEmpty()) { Assert.IsTrue(speciesFactCount > speciesFacts.Count); } userParameterSelection.ReferenceIds = null; }