mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using FluentAssertions;
|
|
using Squidex.Domain.Apps.Core.Schemas;
|
|
using Squidex.Infrastructure;
|
|
using Xunit;
|
|
|
|
namespace Squidex.Domain.Apps.Entities.Schemas.Guards.FieldProperties
|
|
{
|
|
public class ArrayFieldPropertiesTests
|
|
{
|
|
[Fact]
|
|
public void Should_add_error_if_min_items_greater_than_max_items()
|
|
{
|
|
var sut = new ArrayFieldProperties { MinItems = 10, MaxItems = 5 };
|
|
|
|
var errors = FieldPropertiesValidator.Validate(sut).ToList();
|
|
|
|
errors.ShouldBeEquivalentTo(
|
|
new List<ValidationError>
|
|
{
|
|
new ValidationError("Max items must be greater than min items.", "MinItems", "MaxItems")
|
|
});
|
|
}
|
|
}
|
|
}
|