public void TestZoomTo_ToSmallFeatureOnX()
        {
            //(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 incommingEnvelope = Make.Esri.Envelope
                                    .XMax(42.0021 - 0.00416)
                                    .XMin(41.9979)
                                    .YMax(42)
                                    .YMin(41)
                                    .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(42.0021)
                                        .XMin(41.9979)
                                        .YMax(42.0006)
                                        .YMin(41.9994)
                                        .Build;

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

            //Assert
            Validator.Map(factory.MxDocument.FocusMap)
            .NewExtentIsSet(expetedEnvelope)
            .MapIsRefresh
            .Validate();
        }
Esempio n. 2
0
        public void TestZoomTo_ToSmallFeatureOnXNegativeX()
        {
            //Arrange
            var place = new GeoSearchAddress()
            {
                presentationString = "SomePlace"
            };
            var centroid          = Make.Esri.Point.Coords(-250.0, -150.0).Build;
            var incommingEnvelope = Make.Esri.Envelope
                                    .XMax(centroid.X + 1)
                                    .XMin(centroid.X - 1)
                                    .YMax(centroid.Y + 150)
                                    .YMin(centroid.Y - 150)
                                    .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 expectedEnvelope      = Make.Esri.Envelope
                                        .XMax(centroid.X + 125)
                                        .XMin(centroid.X - 125)
                                        .YMax(centroid.Y + 75)
                                        .YMin(centroid.Y - 75)
                                        .Build;

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

            //Assert
            Validator.Map(factory.MxDocument.FocusMap)
            .NewExtentIsSet(expectedEnvelope)
            .MapIsRefresh
            .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();
        }