public void MapSuccessTest()
        {
            ResultController resultController;
            JsonNetResult    result;
            JsonModel        jsonResult;
            SpeciesObservationsGeoJsonModel geoJsonModel;

            resultController = new ResultController();
            SessionHandler.MySettings.Filter.Taxa.TaxonIds = new ObservableCollection <int> {
                100573
            };
            SessionHandler.MySettings.Filter.Taxa.IsActive = true;

            // TODO add more tests on returning view model is null....
            var viewResult = resultController.Maps();

            var viewObsResult = resultController.SpeciesObservationMap();
            var model         = viewObsResult.ViewData.Model;

            // Assert.IsNotNull(viewResult);
            result       = resultController.GetObservationsAsGeoJSON();
            jsonResult   = (JsonModel)result.Data;
            geoJsonModel = (SpeciesObservationsGeoJsonModel)jsonResult.Data;

            Assert.IsNotNull(model);
            Assert.IsNotNull(viewResult);
            Assert.IsTrue(jsonResult.Success);
            Assert.IsNotNull(geoJsonModel);
            Assert.IsTrue(geoJsonModel.Points.Features.Count > 0);
        }
        public void SpeciesRichnessGridMapSuccessTest()
        {
            // Arrange
            ResultController resultController = new ResultController();
            var taxaIds = new ObservableCollection <int> {
                100573
            };

            SessionHandler.MySettings = new MySettings();
            SessionHandler.MySettings.Filter.Taxa.TaxonIds        = taxaIds;
            SessionHandler.MySettings.Filter.Taxa.IsActive        = true;
            SessionHandler.MySettings.Presentation.Table.IsActive = true;
            SessionHandler.MySettings.Calculation.GridStatistics.CalculateNumberOfObservations = false;
            SessionHandler.MySettings.Calculation.GridStatistics.CalculateNumberOfTaxa         = true;
            SessionHandler.MySettings.Calculation.GridStatistics.GridSize           = 50000;
            SessionHandler.MySettings.Calculation.GridStatistics.CoordinateSystemId = (int)GridCoordinateSystem.Rt90_25_gon_v;
            SessionHandler.MySettings.Calculation.GridStatistics.IsActive           = true;

            // Act
            // Get Views and model
            var viewResult = resultController.Maps();

            Assert.IsNotNull(viewResult);

            var result = resultController.SpeciesRichnessGridMap() as ViewResult;

            Assert.IsNotNull(result);
            var viewName = result.ViewName;

            // Get json result from server
            JsonNetResult   taxonResult    = resultController.GetTaxonGridCountAsJSON();
            JsonModel       jsonResult     = (JsonModel)taxonResult.Data;
            TaxonGridResult taxonMapResult = (TaxonGridResult)jsonResult.Data;

            // Assert
            Assert.IsNotNull(result);
            // Assert.IsTrue(viewName.Equals("SpeciesRichnessGridMap"));

            Assert.IsNotNull(taxonResult);
            Assert.IsNotNull(jsonResult);
            Assert.IsTrue(jsonResult.Success);
            Assert.IsNotNull(taxonMapResult);
            Assert.IsTrue(taxonMapResult.Cells.Count > 0);
            Assert.IsTrue(taxonMapResult.Cells[0].SpeciesCount > 0);
            Assert.IsTrue(taxonMapResult.Cells[0].ObservationCount > 0);

            // Not used Assert.IsNotNull(taxonListResult.Cells[0].CentreCoordinate);
            Assert.IsNotNull(taxonMapResult.Cells[0].CentreCoordinateX);
            Assert.IsNotNull(taxonMapResult.Cells[0].CentreCoordinateY);
            Assert.IsNotNull(taxonMapResult.Cells[0].BoundingBox);
            Assert.IsNotNull(taxonMapResult.Cells[0].OriginalCentreCoordinateX);
            Assert.IsNotNull(taxonMapResult.Cells[0].OriginalCentreCoordinateY);

            Assert.IsTrue(taxonMapResult.GridCellCoordinateSystem.Equals(GridCoordinateSystem.Rt90_25_gon_v.ToString()));
        }