Skip to content

Commit d468aef

Browse files
Extend AttributeTests.Global test
1 parent 7d7fce7 commit d468aef

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Atata.Configuration.Json.Tests/AttributeTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ public void Global()
1919
attribute1.Case.Should().Be(TermCase.LowerMerged);
2020
attribute1.TargetTypes.Should().Equal(typeof(Field<,>));
2121
attribute1.TargetAttributeTypes.Should().Equal(typeof(FindByIdAttribute));
22+
attribute1.ExcludeTargetTypes.Should().Equal(typeof(CheckBox<>));
2223

2324
var attribute2 = result[1].Should().BeOfType<FindSettingsAttribute>().Subject;
2425
attribute2.Visibility.Should().Be(Visibility.Any);
2526
attribute2.TargetTypes.Should().Equal(typeof(Table<,>), typeof(Table<,,>));
2627
attribute2.TargetAttributeTypes.Should().Equal(typeof(FindByClassAttribute), typeof(FindByFieldSetAttribute), typeof(FindByLabelAttribute));
28+
attribute2.ExcludeTargetNames.Should().Equal("a", "b");
29+
attribute2.ExcludeTargetParentTypes.Should().Equal(typeof(Frame<>));
2730

2831
var attribute3 = result[2].Should().BeOfType<FindByIdAttribute>().Subject;
2932
attribute3.Values.Should().Equal("some-id");

src/Atata.Configuration.Json.Tests/Configs/Attributes/Global.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "termFindSettings",
66
"targetAttributeType": "FindById",
77
"targetType": "Field`2",
8+
"excludeTargetType": "CheckBox`1",
89
"case": "lowermerged"
910
},
1011
{
@@ -18,7 +19,12 @@
1819
"targetTypes": [
1920
"Table`2",
2021
"Table`3"
21-
]
22+
],
23+
"excludeTargetNames": [
24+
"a",
25+
"b"
26+
],
27+
"excludeTargetParentType": "Frame`1"
2228
},
2329
{
2430
"type": "FindById",

0 commit comments

Comments
 (0)