Exemple #1
0
 private ArtDatabanken.Data.ArtDatabankenService.Taxon GetTaxon()
 {
     if (_taxon.IsNull())
     {
         _taxon = TaxonManagerTest.GetOneTaxon();
     }
     return(_taxon);
 }
Exemple #2
0
 public void AreNotEqual()
 {
     Assert.IsFalse(DataId.AreNotEqual(null, null));
     Assert.IsTrue(DataId.AreNotEqual(GetDataId(), null));
     Assert.IsTrue(DataId.AreNotEqual(null, GetDataId()));
     Assert.IsTrue(DataId.AreNotEqual(GetDataId(), TaxonManagerTest.GetOneTaxon()));
     Assert.IsFalse(DataId.AreNotEqual(GetDataId(), GetDataId()));
     Assert.IsTrue(DataId.AreNotEqual(GetDataId(), ArtDatabanken.Data.ArtDatabankenService.TaxonManager.GetTaxonTypes()[2]));
 }
        public void GetUserDataSetByParameterSelection()
        {
            UserDataSet            userDataSet = null, userDataSet2;
            UserParameterSelection userParmeterSelection;

            userParmeterSelection = new UserParameterSelection();

            userParmeterSelection.Taxa.Merge(ArtDatabanken.Data.ArtDatabankenService.TaxonManager.GetTaxa(TaxonManagerTest.GetTaxaIds(), TaxonInformationType.Basic));
            Data.ArtDatabankenService.FactorList factors;
            factors = new Data.ArtDatabankenService.FactorList();
            factors.Add(Data.ArtDatabankenService.FactorManager.GetFactor(LANDSCAPE_FACTOR_ID));
            userParmeterSelection.Factors.Merge(factors);

            userDataSet = Data.ArtDatabankenService.SpeciesFactManager.GetUserDataSetByParameterSelection(userParmeterSelection);
            Assert.IsNotNull(userDataSet);
            Assert.IsTrue(userDataSet.SpeciesFacts.IsNotEmpty());
            Assert.IsTrue(userDataSet.SpeciesFacts.Count > 2);

            // Test problem where automatic SpeciesFact is
            // added to the UserDataSet but dependent
            // SpeicesFact is not in the UserDataSet.
            userParmeterSelection = new UserParameterSelection();
            userParmeterSelection.Taxa.Add(TaxonManagerTest.GetOneTaxon());
            userParmeterSelection.Factors.Add(Data.ArtDatabankenService.FactorManager.GetFactor(Data.ArtDatabankenService.FactorId.RedListCategoryAutomatic));
            userDataSet = Data.ArtDatabankenService.SpeciesFactManager.GetUserDataSetByParameterSelection(userParmeterSelection);
            Assert.IsTrue(userDataSet.SpeciesFacts.IsNotEmpty());
            Assert.IsTrue(userDataSet.Factors.Count > 30);

            // Test problem where periodic SpeciesFact are combined
            // with none default IndividualCategory.
            userParmeterSelection = new UserParameterSelection();
            userParmeterSelection.Taxa.Add(TaxonManagerTest.GetOneTaxon());
            userParmeterSelection.Factors.Add(Data.ArtDatabankenService.FactorManager.GetFactor(Data.ArtDatabankenService.FactorId.PopulationSize_Total));
            userDataSet = Data.ArtDatabankenService.SpeciesFactManager.GetUserDataSetByParameterSelection(userParmeterSelection);
            userParmeterSelection.IndividualCategories.Add(IndividualCategoryManager.GetIndividualCategory(INDIVIDUAL_CATEGORY_ID_IMAGO));
            userDataSet2 = Data.ArtDatabankenService.SpeciesFactManager.GetUserDataSetByParameterSelection(userParmeterSelection);
            Assert.AreEqual(userDataSet.SpeciesFacts.Count, userDataSet2.SpeciesFacts.Count);
        }
 private Data.ArtDatabankenService.SpeciesObservationArea GetSpeciesObservationArea(Boolean refresh)
 {
     if (_speciesObservationArea.IsNull() || refresh)
     {
         _speciesObservationArea = new Data.ArtDatabankenService.SpeciesObservationArea(TaxonManagerTest.GetOneTaxon(),
                                                                                        543,
                                                                                        2000,
                                                                                        50000,
                                                                                        53450000000,
                                                                                        5435340000000000);
     }
     return(_speciesObservationArea);
 }