Exemple #1
0
        public void TestZoomTo_ToSmallFeatureOnY()
        {
            //Arrange
            var place = new GeoSearchAddress()
            {
                presentationString = "SomePlace"
            };
            IPoint point             = Make.Esri.Point.Build;
            var    incommingEnvelope = Make.Esri.Envelope
                                       .XMax(point.X + 150)
                                       .XMin(point.X - 150)
                                       .YMax(point.Y + 1)
                                       .YMin(point.Y - 1)
                                       .Build;
            var geometry = Make.Esri.Geometry.WithEnvelope(incommingEnvelope).Build;
            var factory  = Make.Factory(place).ConvertWKTToGeometryReturns(geometry).Build;
            var placeFinderController = new PlaceFinderController(factory);
            var expetedEnvelope       = Make.Esri.Envelope
                                        .XMax(point.X + 125)
                                        .XMin(point.X - 125)
                                        .YMax(point.Y + 75)
                                        .YMin(point.Y - 75).Build;

            //Act
            placeFinderController.SearchTextChange(place.presentationString);
            placeFinderController.ZoomTo(place);

            //Assert
            Validator.Map(factory.MxDocument.FocusMap)
            .NewExtentIsSet(expetedEnvelope)
            .MapIsRefresh
            .Validate();
        }
        public void TestSearchTextChange()
        {
            //Arrange
            var      place   = "SomePlace";
            IFactory factory = Make.Factory(new GeoSearchAddress()
            {
                presentationString = "SomePlace"
            }).Build;
            var placeFinderController = new PlaceFinderController(factory);

            //Act
            placeFinderController.SearchTextChange(place);

            //Assert
            Validator.PlaceFinderWindow(factory.PlaceFinderDockableWindow).SearchResultAdded.Validate();
        }
        public void TestResourceChange()
        {
            //Arrange
            var place        = "SomePlace";
            var resourceList = new List <object> {
                "Husnumre", "Adresser"
            };
            var factory = Make.Factory(new GeoSearchAddress()
            {
                presentationString = "SomePlace"
            }).Build;
            var placeFinderController = new PlaceFinderController(factory);

            //Act
            placeFinderController.SearchResourcesChange(resourceList);
            placeFinderController.SearchTextChange(place);

            //Assert
            Validator.PlaceFinderWindow(factory.PlaceFinderDockableWindow).Validate();
            Validator.GeosearchService(factory.GeosearchService).RequestCallWithSearchResources("Adresser,Husnumre").Validate();
        }
        public void TestZoomTo()
        {
            //Arrange
            var place = new GeoSearchAddress()
            {
                presentationString = "SomePlace"
            };
            IFactory factory = Make.Factory(place).Build;
            var      placeFinderController = new PlaceFinderController(factory);
            var      expetedEnvelope       = Make.Esri.Envelope.Build;

            //Act
            placeFinderController.SearchTextChange(place.presentationString);
            placeFinderController.ZoomTo(place);

            //Assert
            Validator.Map(factory.MxDocument.FocusMap)
            .NewExtentIsSet(expetedEnvelope)
            .MapIsRefresh
            .Validate();
        }
        public void TestZoomTo_ToSmallFeatureOnYWithNegativY()
        {
            //(y) nord south 150 m is 150/(1000*60*2) = 0,00125
            //(x) east vest 250 m is 200/(1000*60) = 0,00416
            //Arrange
            var place = new GeoSearchAddress()
            {
                presentationString = "SomePlace"
            };
            var centroid          = Make.Esri.Point.Coords(-42.0, -42.0).Build;
            var incommingEnvelope = Make.Esri.Envelope
                                    .XMax(-41)
                                    .XMin(-42)
                                    .YMax(-41.9993 - 0.00125)
                                    .YMin(-42.00063)
                                    .WithCentroid(centroid)
                                    .Build;
            var geometry = Make.Esri.Geometry
                           .WithEnvelope(incommingEnvelope)
                           .Build;
            var factory = Make.Factory(place).ConvertWKTToGeometryReturns(geometry).Build;
            var placeFinderController = new PlaceFinderController(factory);
            var expetedEnvelope       = Make.Esri.Envelope
                                        .XMax(-41.9979)
                                        .XMin(-42.0021)
                                        .YMax(-41.9994)
                                        .YMin(-42.0006)
                                        .Build;

            //Act
            placeFinderController.SearchTextChange(place.presentationString);
            placeFinderController.ZoomTo(place);

            //Assert
            Validator.Map(factory.MxDocument.FocusMap)
            .NewExtentIsSet(expetedEnvelope)
            .MapIsRefresh
            .Validate();
        }