コード例 #1
0
        public void FilterGeoBoundingBox_SetsCorrectTypeAndCoords()
        {
            var topLeft     = (59.9277542, 10.7190847);
            var bottomRight = (59.8881646, 10.7983952);

            var    service = _service.FilterGeoBoundingBox(x => x.GeoPointProperty, topLeft, bottomRight) as ElasticSearchService <ComplexType>;
            Filter result  = service.PostFilters.Single(f => f.FieldName == nameof(ComplexType.GeoPointProperty));
            var    value   = result.Value as GeoBoundingBox;

            Assert.True(result.Type == typeof(GeoPoint));
            Assert.Equal(topLeft.Item1, value.Box.TopLeft.Lat);
            Assert.Equal(topLeft.Item2, value.Box.TopLeft.Lon);
            Assert.Equal(bottomRight.Item1, value.Box.BottomRight.Lat);
            Assert.Equal(bottomRight.Item2, value.Box.BottomRight.Lon);
        }