public IEnumerable <IValidator> Visit(GeolocationFieldProperties properties) { if (properties.IsRequired) { yield return(new RequiredValidator()); } }
public IEnumerable <ValidationError> Visit(GeolocationFieldProperties properties) { if (!properties.Editor.IsEnumValue()) { yield return(new ValidationError("Editor is not a valid value.", nameof(properties.Editor))); } }
public IEnumerable <ValidationError> Visit(GeolocationFieldProperties properties, None args) { if (!properties.Editor.IsEnumValue()) { yield return(new ValidationError(Not.Valid(nameof(properties.Editor)), nameof(properties.Editor))); } }
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") }); }
public FieldPropertiesDto Visit(GeolocationFieldProperties properties) { return(SimpleMapper.Map(properties, new GeolocationFieldPropertiesDto())); }
private static FieldPropertiesDto Convert(GeolocationFieldProperties source) { var result = SimpleMapper.Map(source, new GeolocationFieldPropertiesDto()); return(result); }
private static GeolocationField Field(GeolocationFieldProperties properties) { return(new GeolocationField(1, "my-geolocation", Partitioning.Invariant, properties)); }
private static RootField <GeolocationFieldProperties> Field(GeolocationFieldProperties properties) { return(Fields.Geolocation(1, "my-geolocation", Partitioning.Invariant, properties)); }
public IJsonValue Visit(GeolocationFieldProperties properties, Args args) { return(JsonValue.Null); }
public JToken Visit(GeolocationFieldProperties properties) { return(JValue.CreateNull()); }
public static Schema AddGeolocation(this Schema schema, long id, string name, Partitioning partitioning, GeolocationFieldProperties properties = null) { return(schema.AddField(Geolocation(id, name, partitioning, properties))); }
public static Field <GeolocationFieldProperties> Geolocation(long id, string name, Partitioning partitioning, GeolocationFieldProperties properties = null) { return(new Field <GeolocationFieldProperties>(id, name, partitioning, properties ?? new GeolocationFieldProperties())); }