コード例 #1
0
        public void GetSpeciesObservationData_AddSpeciesObservationDataAndChangeMySettingsAfterwards_ResultCacheItemIsNotUpToDate()
        {
            SpeciesObservationsData speciesObservationsData;

            speciesObservationsData = CreateSpeciesObservationDataSample();

            CalculatedDataItemCacheManager.GetSpeciesObservationData(SessionHandler.MySettings, "").Data = speciesObservationsData;
            CalculatedDataItem <SpeciesObservationsData> calculatedDataItem = CalculatedDataItemCacheManager.GetSpeciesObservationData(SessionHandler.MySettings, "");

            SessionHandler.MySettings.ResultCacheNeedsRefresh = false;
            SessionHandler.MySettings.Filter.Taxa.AddTaxonId(1);

            Assert.IsFalse(calculatedDataItem.HasFreshData);
        }
コード例 #2
0
        public void GetSpeciesObservationData_AddSpeciesObservationDataBeforeGet_ResultCacheItemReturned()
        {
            SpeciesObservationsData speciesObservationsData;

            speciesObservationsData = CreateSpeciesObservationDataSample();

            CalculatedDataItemCacheManager.GetSpeciesObservationData(SessionHandler.MySettings, "sv").Data = speciesObservationsData;
            CalculatedDataItem <SpeciesObservationsData> calculatedDataItem = CalculatedDataItemCacheManager.GetSpeciesObservationData(SessionHandler.MySettings, "sv");

            SessionHandler.MySettings.ResultCacheNeedsRefresh = false;

            Assert.IsTrue(calculatedDataItem.HasData);
            Assert.IsTrue(calculatedDataItem.HasFreshData);
        }
        public void GetQueryComplexityEstimate_ObservationMapWithoutTaxaFilterButWithCachedResult_ReturnFastEstimate()
        {
            SpeciesObservationsData speciesObservationsData;

            //QueryComplexityEstimate result;
            LoginApplicationUser();

            speciesObservationsData = CreateSpeciesObservationData(SessionHandler.UserContext, SessionHandler.MySettings);
            CalculatedDataItemCacheManager.GetSpeciesObservationData(SessionHandler.MySettings, "").Data = speciesObservationsData;
            SpeciesObservationResultCalculator resultCalculator = new SpeciesObservationResultCalculator(SessionHandler.UserContext, SessionHandler.MySettings);
            QueryComplexityEstimate            result           = resultCalculator.GetQueryComplexityEstimate();

            //result = QueryComplexityManager.GetQueryComplexityEstimate(ResultType.SpeciesObservationMap, SessionHandler.UserContext, SessionHandler.MySettings);
            Assert.AreEqual(QueryComplexityExecutionTime.Fast, result.QueryComplexityExecutionTime);
        }