Skip to content

Commit ad21b7b

Browse files
Add missing assertion in ObjectSyntaxElementsTests
Signed-off-by: Alexander Linne <[email protected]>
1 parent b31629b commit ad21b7b

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

ArchUnitNETTests/Fluent/Syntax/Elements/ObjectSyntaxElementsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ public async Task HaveAnyAttributesTest()
648648
should = Types().That().Are(helper.ClassWithTwoAttributes).Should();
649649

650650
helper.AddSnapshotSubHeader("Conditions");
651-
should.HaveAnyAttributes();
651+
should.HaveAnyAttributes().AssertOnlyViolations(helper);
652652
should.HaveAnyAttributes(new List<Attribute>()).AssertOnlyViolations(helper);
653653
should.HaveAnyAttributes(new List<System.Type>()).AssertOnlyViolations(helper);
654654
should.HaveAnyAttributes(Attributes().That().HaveFullName(helper.NonExistentObjectName)).AssertOnlyViolations(helper);
@@ -1650,7 +1650,7 @@ public async Task NotCallAnyTest()
16501650
should = MethodMembers().That().Are(helper.MethodWithSingleDependency).Should();
16511651

16521652
helper.AddSnapshotSubHeader("Conditions");
1653-
should.NotCallAny();
1653+
should.NotCallAny().AssertNoViolations(helper);
16541654
should.NotCallAny(new List<MethodMember>()).AssertNoViolations(helper);
16551655

16561656
helper.AddSnapshotSubHeader("Predicates");

ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectSyntaxElementsTests.HaveAnyAttributesTest.verified.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ Message:
261261

262262

263263

264+
Query: Types that are "AttributeNamespace.ClassWithTwoAttributes" should have any of no attributes (impossible)
265+
Result: False
266+
Description: AttributeNamespace.ClassWithTwoAttributes only has attributes "AttributeNamespace.Attribute1" and "AttributeNamespace.Attribute2"
267+
Message:
268+
"Types that are "AttributeNamespace.ClassWithTwoAttributes" should have any of no attributes (impossible)" failed:
269+
AttributeNamespace.ClassWithTwoAttributes only has attributes "AttributeNamespace.Attribute1" and "AttributeNamespace.Attribute2"
270+
271+
272+
264273
Query: Types that are "AttributeNamespace.ClassWithTwoAttributes" should have any Attributes that have full name "NotTheNameOfAnyObject"
265274
Result: False
266275
Description: AttributeNamespace.ClassWithTwoAttributes only has attributes "AttributeNamespace.Attribute1" and "AttributeNamespace.Attribute2"

ArchUnitNETTests/Fluent/Syntax/Elements/Snapshots/ObjectSyntaxElementsTests.NotCallAnyTest.verified.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ Description: System.Void MethodDependencyNamespace.MethodDependencyClass::Method
159159
Message:
160160
All Evaluations passed
161161

162+
Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithSingleDependency()" should not call any of no methods (always true)
163+
Result: True
164+
Description: System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithSingleDependency() passed
165+
Message:
166+
All Evaluations passed
167+
162168
----- Predicates -----
163169

164170
Query: Method members that are "System.Void MethodDependencyNamespace.MethodDependencyClass::MethodWithSingleDependency()" should be Method members that do not call any of no methods (always true)

0 commit comments

Comments
 (0)