|
|
|
@ -27,6 +27,18 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[RuleAction( |
|
|
|
IconImage = "<svg></svg>", |
|
|
|
IconColor = "#1e5470", |
|
|
|
Display = "Action display", |
|
|
|
Description = "Action description.", |
|
|
|
ReadMore = "https://www.readmore.com/")] |
|
|
|
public sealed class MyInvalidRuleAction : RuleAction |
|
|
|
{ |
|
|
|
[DataType(DataType.Custom)] |
|
|
|
public string Custom { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
[RuleAction( |
|
|
|
IconImage = "<svg></svg>", |
|
|
|
IconColor = "#1e5470", |
|
|
|
@ -53,16 +65,16 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules |
|
|
|
[DataType(DataType.Password)] |
|
|
|
public string Password { get; set; } |
|
|
|
|
|
|
|
[DataType(DataType.Custom)] |
|
|
|
[DataType(DataType.Text)] |
|
|
|
public bool Boolean { get; set; } |
|
|
|
|
|
|
|
[DataType(DataType.Custom)] |
|
|
|
[DataType(DataType.Text)] |
|
|
|
public bool? BooleanOptional { get; set; } |
|
|
|
|
|
|
|
[DataType(DataType.Custom)] |
|
|
|
[DataType(DataType.Text)] |
|
|
|
public int Number { get; set; } |
|
|
|
|
|
|
|
[DataType(DataType.Custom)] |
|
|
|
[DataType(DataType.Text)] |
|
|
|
public int? NumberOptional { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
@ -167,5 +179,11 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules |
|
|
|
|
|
|
|
currentDefinition.Should().BeEquivalentTo(expected); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Should_throw_exception_if_validation_attribute_used_incorrectly() |
|
|
|
{ |
|
|
|
Assert.Throws<InvalidOperationException>(() => sut.Add<MyInvalidRuleAction>()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|