コード例 #1
0
        public void GetSpeciesObservationChangeBirdRingingCentre()
        {
            Boolean               areMoreSpeciesObservationsAvailable;
            ConnectorServer       connectorServer = new ConnectorServer();
            DateTime              changedFrom     = new DateTime(2000, 1, 1);
            DateTime              changedTo       = changedFrom;
            GbifConnector         connector       = new BirdRingingCentreConnector();
            List <HarvestMapping> mappings;
            List <WebSpeciesObservationFieldDescriptionExtended> fieldDescriptions;
            WebSpeciesObservationDataProvider dataProvider;

            dataProvider      = connector.GetSpeciesObservationDataProvider(GetContext());
            fieldDescriptions = WebServiceData.MetadataManager.GetSpeciesObservationFieldDescriptionsExtended(GetContext());
            mappings          = HarvestManager.CreateMappingList(fieldDescriptions, dataProvider.Id);
            try
            {
                GetContext().GetSpeciesObservationDatabase().SetMaxChangeId(dataProvider.Id, dataProvider.MaxChangeId - 1);
                GetContext().GetSpeciesObservationDatabase().EmptyTempTables();
                areMoreSpeciesObservationsAvailable = connector.GetSpeciesObservationChange(changedFrom,
                                                                                            changedTo,
                                                                                            mappings,
                                                                                            GetContext(),
                                                                                            connectorServer);
                Assert.IsFalse(areMoreSpeciesObservationsAvailable);
            }
            catch (Exception)
            {
                GetContext().GetSpeciesObservationDatabase().SetMaxChangeId(dataProvider.Id, dataProvider.MaxChangeId);
                throw;
            }
        }
コード例 #2
0
        public void GetSpeciesObservationCountBirdRingingCentre()
        {
            GbifConnector connector = new BirdRingingCentreConnector();
            Int64         speciesObservationCount;

            speciesObservationCount = connector.GetSpeciesObservationCount();
            Assert.AreNotEqual(speciesObservationCount, -1);
            Debug.WriteLine("Bird Ringing Centre (GBIF), total number of species observations are " + speciesObservationCount);
        }
コード例 #3
0
        public void GetSpeciesObservationDataProviderBirdRingingCentre()
        {
            GbifConnector connector = new BirdRingingCentreConnector();
            WebSpeciesObservationDataProvider dataProvider;

            dataProvider = connector.GetSpeciesObservationDataProvider(GetContext());
            Assert.IsNotNull(dataProvider);
            Assert.AreEqual(dataProvider.Id, (Int32)(SpeciesObservationDataProviderId.BirdRingingCentre));
        }
コード例 #4
0
        public void GetPageCountBirdRingingCentre()
        {
            GbifConnector connector = new BirdRingingCentreConnector();
            Int64         pageCount, speciesObservationCount;

            speciesObservationCount = connector.GetSpeciesObservationCount();
            Assert.IsTrue(0 < speciesObservationCount);
            Debug.WriteLine("Bird Ringing Centre (GBIF), total number of species observations is " + speciesObservationCount);
            pageCount = connector.GetPageCount(speciesObservationCount);
            Assert.IsTrue(0 < pageCount);
            Debug.WriteLine("Bird Ringing Centre (GBIF), total number of pages is " + pageCount);
        }