public void GetQueryComplexityEstimate_ObservationMapWithoutTaxaFilter_ReturnSlowEstimate()
        {
            SpeciesObservationResultCalculator resultCalculator = new SpeciesObservationResultCalculator(SessionHandler.UserContext, SessionHandler.MySettings);
            QueryComplexityEstimate            result           = resultCalculator.GetQueryComplexityEstimate();

            //var result = QueryComplexityManager.GetQueryComplexityEstimate(ResultType.SpeciesObservationMap, SessionHandler.UserContext, SessionHandler.MySettings);
            Assert.AreEqual(QueryComplexityExecutionTime.Slow, result.QueryComplexityExecutionTime);
        }
        public void GetQueryComplexityEstimate_ObservationMapWith100Taxa_ReturnMediumEstimate()
        {
            SessionHandler.MySettings.Filter.Taxa.AddTaxonIds(Enumerable.Range(1, 100));
            //var result = QueryComplexityManager.GetQueryComplexityEstimate(ResultType.SpeciesObservationMap, SessionHandler.UserContext, SessionHandler.MySettings);
            SpeciesObservationResultCalculator resultCalculator = new SpeciesObservationResultCalculator(SessionHandler.UserContext, SessionHandler.MySettings);
            QueryComplexityEstimate            result           = resultCalculator.GetQueryComplexityEstimate();

            Assert.AreEqual(QueryComplexityExecutionTime.Medium, result.QueryComplexityExecutionTime);
        }
        public void GetQueryComplexityEstimate_ObservationMapWithoutTaxaFilter_ReturnGridMapResultViewSuggestion()
        {
            SpeciesObservationResultCalculator resultCalculator = new SpeciesObservationResultCalculator(SessionHandler.UserContext, SessionHandler.MySettings);
            QueryComplexityEstimate            result           = resultCalculator.GetQueryComplexityEstimate(false);

            //QueryComplexityEstimate result;
            //result = QueryComplexityManager.GetQueryComplexityEstimate(
            //    ResultType.SpeciesObservationMap,
            //    SessionHandler.UserContext,
            //    SessionHandler.MySettings);
            Assert.AreEqual(ResultType.SpeciesObservationGridMap, result.ComplexityDescription.SuggestedResultViews[0].ResultType);
        }
        public void GetQueryComplexityEstimate_ObservationMapWith1TaxaWithSpatialFilter_ReturnMediumEstimate()
        {
            DataPolygon dataPolygon = CreateSampleDataPolygon();

            SessionHandler.MySettings.Filter.Taxa.AddTaxonId(1);
            SessionHandler.MySettings.Filter.Spatial.Polygons.Add(dataPolygon);
            //var result = QueryComplexityManager.GetQueryComplexityEstimate(ResultType.SpeciesObservationMap, SessionHandler.UserContext, SessionHandler.MySettings);
            SpeciesObservationResultCalculator resultCalculator = new SpeciesObservationResultCalculator(SessionHandler.UserContext, SessionHandler.MySettings);
            QueryComplexityEstimate            result           = resultCalculator.GetQueryComplexityEstimate();

            Assert.AreEqual(QueryComplexityExecutionTime.Medium, result.QueryComplexityExecutionTime);
        }
        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);
        }