public void PrecisionSurvivesDeserialize() { var mapping = new GeoShapeMapping() { Name = Property.Name <ElasticsearchProject>(p => p.MyGeoShape), Precision = new GeoPrecision(3.4, GeoPrecisionUnit.Yard) }; var serialized = this._client.Serializer.Serialize(mapping); var deserialized = this._client.Serializer.Deserialize <GeoShapeMapping>(new MemoryStream(serialized)); deserialized.Should().NotBeNull(); deserialized.Precision.Should().NotBeNull(); deserialized.Precision.Precision.Should().Be(3.4); deserialized.Precision.Unit.Should().Be(GeoPrecisionUnit.Yard); }
public void PrecisionSurvivesDeserialize() { var mapping = new GeoShapeMapping() { Name = Property.Name<ElasticsearchProject>(p => p.MyGeoShape), Precision = new GeoPrecision(3.4, GeoPrecisionUnit.Yard) }; var serialized = this._client.Serializer.Serialize(mapping); var deserialized = this._client.Serializer.Deserialize<GeoShapeMapping>(new MemoryStream(serialized)); deserialized.Should().NotBeNull(); deserialized.Precision.Should().NotBeNull(); deserialized.Precision.Precision.Should().Be(3.4); deserialized.Precision.Unit.Should().Be(GeoPrecisionUnit.Yard); }
public void Visit(GeoShapeMapping mapping) { this.PrettyPrint(mapping); }