public void References()
        {
            UserParameterSelection userParameterSelection = GetUserParameterSelection();

            Assert.AreEqual(userParameterSelection.References.IsNotEmpty(), userParameterSelection.HasReferences);

            userParameterSelection.References.Merge(ReferenceManagerTest.GetSomeReferences());
            Assert.IsTrue(userParameterSelection.References.IsNotEmpty());
            Assert.IsTrue(userParameterSelection.References.Count > 6);
            Assert.IsTrue(userParameterSelection.HasReferences);
        }
예제 #2
0
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        private Data.ArtDatabankenService.Reference GetReference()
        {
            return(ReferenceManagerTest.GetSomeReferences()[0]);
        }
        public void GetSpeciesFactByUserParameterSelection()
        {
            FactorList factors;

            Data.ArtDatabankenService.IndividualCategoryList individualCategories;
            Int32 count;

            Data.ArtDatabankenService.PeriodList periods;
            ReferenceList references;

            Data.ArtDatabankenService.SpeciesFactList speciesFacts;
            Data.ArtDatabankenService.TaxonList       hosts, taxa;
            UserParameterSelection userParmeterSelection;

            userParmeterSelection = new UserParameterSelection();
            factors = FactorManagerTest.GetSomeFactors();
            hosts   = TaxonManagerTest.GetSomeTaxa();
            individualCategories = IndividualCategoryManagerTest.GetSomeIndividualCategories();
            periods    = PeriodManagerTest.GetSomePeriods();
            references = ReferenceManagerTest.GetSomeReferences();
            taxa       = hosts;

            userParmeterSelection.Taxa.Merge(taxa);
            speciesFacts = Data.ArtDatabankenService.SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(userParmeterSelection);
            Assert.IsTrue(speciesFacts.IsNotEmpty());
            count = speciesFacts.Count;

            userParmeterSelection.Factors.Merge(factors);
            speciesFacts = Data.ArtDatabankenService.SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(userParmeterSelection);
            if (speciesFacts.IsNotEmpty())
            {
                Assert.IsTrue(count > speciesFacts.Count);
            }
            userParmeterSelection.Factors.Clear();

            userParmeterSelection.Hosts.Merge(hosts);
            speciesFacts = Data.ArtDatabankenService.SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(userParmeterSelection);
            if (speciesFacts.IsNotEmpty())
            {
                Assert.IsTrue(count > speciesFacts.Count);
            }
            userParmeterSelection.Hosts.Clear();

            userParmeterSelection.IndividualCategories.Merge(individualCategories);
            speciesFacts = Data.ArtDatabankenService.SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(userParmeterSelection);
            if (speciesFacts.IsNotEmpty())
            {
                Assert.IsTrue(count > speciesFacts.Count);
            }
            userParmeterSelection.IndividualCategories.Clear();

            userParmeterSelection.Periods.Merge(periods);
            speciesFacts = Data.ArtDatabankenService.SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(userParmeterSelection);
            if (speciesFacts.IsNotEmpty())
            {
                Assert.IsTrue(count > speciesFacts.Count);
            }
            userParmeterSelection.Periods.Clear();

            userParmeterSelection.References.Merge(references);
            speciesFacts = Data.ArtDatabankenService.SpeciesFactManager.GetSpeciesFactsByUserParameterSelection(userParmeterSelection);
            if (speciesFacts.IsNotEmpty())
            {
                Assert.IsTrue(count > speciesFacts.Count);
            }
            userParmeterSelection.References.Clear();
        }