Example #1
0
        public void ImplicitConversion()
        {
            Nest.Distance distanceString          = "25";
            Nest.Distance distanceStringWithUnits = "25m";

            Expect(new Nest.Distance(25))
            .WhenSerializing(distanceString)
            .WhenSerializing(distanceStringWithUnits);
        }
Example #2
0
        public void Constructor()
        {
            var unitComposed          = new Nest.Distance(25);
            var unitComposedWithUnits = new Nest.Distance(25, DistanceUnit.Meters);

            /**
             * When serializing Distance constructed from a string, composition of distance value and unit
             */
            Expect("25.0m")
            .WhenSerializing(unitComposed)
            .WhenSerializing(unitComposedWithUnits);
        }
		public void Constructor()
		{
			var unitComposed = new Nest.Distance(25);
			var unitComposedWithUnits = new Nest.Distance(25, DistanceUnit.Meters);

			/**
			* When serializing Distance constructed from a string, composition of distance value and unit
			*/
			Expect("25.0m")
				.WhenSerializing(unitComposed)
				.WhenSerializing(unitComposedWithUnits);
		}
		public void Constructor()
		{
			var unitComposed = new Distance(25);
			var unitComposedWithUnits = new Distance(25, Nest.DistanceUnit.Meters);

			/**
			* `Distance` serializes to a string composed of a factor and distance unit.
			* The factor is a double so always has at least one decimal place when serialized
			*/
			Expect("25.0m")
				.WhenSerializing(unitComposed)
				.WhenSerializing(unitComposedWithUnits);
		}
Example #5
0
 public GeoHashCellQueryDescriptor <T> Precision(Distance precision) => Assign(a => a.Precision = precision);
 public SuggestContextQueryDescriptor <T> Precision(Distance precision) => Assign(a => a.Precision = precision);
Example #7
0
 public GeoSuggestContextDescriptor <T> Precision(Distance precision) => Assign(precision, (a, v) => a.Precision = v);
Example #8
0
 public GeoPointFielddataDescriptor Precision(Distance distance) => Assign(distance, (a, v) => a.Precision = v);
Example #9
0
 public GeoDistanceQueryDescriptor <T> Distance(Distance distance) => Assign(a => a.Distance = distance);