Пример #1
0
 public IEnumerable <IValidator> Visit(GeolocationFieldProperties properties)
 {
     if (properties.IsRequired)
     {
         yield return(new RequiredValidator());
     }
 }
Пример #2
0
 public IEnumerable <ValidationError> Visit(GeolocationFieldProperties properties)
 {
     if (!properties.Editor.IsEnumValue())
     {
         yield return(new ValidationError("Editor is not a valid value.",
                                          nameof(properties.Editor)));
     }
 }
Пример #3
0
 public IEnumerable <ValidationError> Visit(GeolocationFieldProperties properties, None args)
 {
     if (!properties.Editor.IsEnumValue())
     {
         yield return(new ValidationError(Not.Valid(nameof(properties.Editor)),
                                          nameof(properties.Editor)));
     }
 }
Пример #4
0
        public void Should_add_error_if_editor_is_not_valid()
        {
            var sut = new GeolocationFieldProperties {
                Editor = (GeolocationFieldEditor)123
            };

            var errors = FieldPropertiesValidator.Validate(sut).ToList();

            errors.Should().BeEquivalentTo(
                new List <ValidationError>
            {
                new ValidationError("Editor is not a valid value.", "Editor")
            });
        }
Пример #5
0
 public FieldPropertiesDto Visit(GeolocationFieldProperties properties)
 {
     return(SimpleMapper.Map(properties, new GeolocationFieldPropertiesDto()));
 }
Пример #6
0
        private static FieldPropertiesDto Convert(GeolocationFieldProperties source)
        {
            var result = SimpleMapper.Map(source, new GeolocationFieldPropertiesDto());

            return(result);
        }
Пример #7
0
 private static GeolocationField Field(GeolocationFieldProperties properties)
 {
     return(new GeolocationField(1, "my-geolocation", Partitioning.Invariant, properties));
 }
Пример #8
0
 private static RootField <GeolocationFieldProperties> Field(GeolocationFieldProperties properties)
 {
     return(Fields.Geolocation(1, "my-geolocation", Partitioning.Invariant, properties));
 }
Пример #9
0
 public IJsonValue Visit(GeolocationFieldProperties properties, Args args)
 {
     return(JsonValue.Null);
 }
Пример #10
0
 public JToken Visit(GeolocationFieldProperties properties)
 {
     return(JValue.CreateNull());
 }
Пример #11
0
 public static Schema AddGeolocation(this Schema schema, long id, string name, Partitioning partitioning, GeolocationFieldProperties properties = null)
 {
     return(schema.AddField(Geolocation(id, name, partitioning, properties)));
 }
Пример #12
0
 public static Field <GeolocationFieldProperties> Geolocation(long id, string name, Partitioning partitioning, GeolocationFieldProperties properties = null)
 {
     return(new Field <GeolocationFieldProperties>(id, name, partitioning, properties ?? new GeolocationFieldProperties()));
 }