Exemple #1
0
        public void Should_not_add_error_if_inline_editing_is_allowed_for_editor(NumberFieldEditor editor)
        {
            var sut = new NumberFieldProperties {
                InlineEditable = true, Editor = editor, AllowedValues = ImmutableList.Create(1.0)
            };

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

            Assert.Empty(errors);
        }
Exemple #2
0
        public void Should_add_error_if_inline_editing_is_not_allowed_for_editor(NumberFieldEditor editor)
        {
            var sut = new NumberFieldProperties {
                InlineEditable = true, Editor = editor, AllowedValues = ImmutableList.Create(1.0)
            };

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

            errors.Should().BeEquivalentTo(
                new List <ValidationError>
            {
                new ValidationError("Inline editing is not allowed for Radio editor.", "InlineEditable", "Editor")
            });
        }
Exemple #3
0
        public void Should_add_error_if_inline_editing_is_not_allowed_for_editor(NumberFieldEditor editor)
        {
            var sut = new NumberFieldProperties {
                InlineEditable = true, Editor = editor, AllowedValues = ReadOnlyCollection.Create(1.0)
            };

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

            errors.Should().BeEquivalentTo(
                new List <ValidationError>
            {
                new ValidationError("Inline editing is only allowed for dropdowns and input fields.", "InlineEditable", "Editor")
            });
        }