|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using ArchUnitNET.Domain; |
| 4 | +using ArchUnitNET.Fluent.Conditions; |
| 5 | +using ArchUnitNET.Fluent.Syntax.Elements.Types; |
| 6 | +using ArchUnitNET.Fluent.Syntax.Elements.Types.Attributes; |
| 7 | +using Attribute = ArchUnitNET.Domain.Attribute; |
| 8 | + |
| 9 | +namespace ArchUnitNET.Fluent.Syntax.Elements |
| 10 | +{ |
| 11 | + public interface IAddObjectCondition<TNextElement, TRuleType> |
| 12 | + where TRuleType : ICanBeAnalyzed |
| 13 | + { |
| 14 | + // csharpier-ignore-start |
| 15 | + |
| 16 | + TNextElement Exist(); |
| 17 | + |
| 18 | + TNextElement Be(params ICanBeAnalyzed[] objects); |
| 19 | + TNextElement Be(IEnumerable<ICanBeAnalyzed> objects); |
| 20 | + TNextElement Be(IObjectProvider<ICanBeAnalyzed> objects); |
| 21 | + |
| 22 | + TNextElement CallAny(params MethodMember[] methods); |
| 23 | + TNextElement CallAny(IEnumerable<MethodMember> methods); |
| 24 | + TNextElement CallAny(IObjectProvider<MethodMember> methods); |
| 25 | + |
| 26 | + TNextElement DependOnAny(); |
| 27 | + TNextElement DependOnAny(params IType[] types); |
| 28 | + TNextElement DependOnAny(params Type[] types); |
| 29 | + TNextElement DependOnAny(IObjectProvider<IType> types); |
| 30 | + TNextElement DependOnAny(IEnumerable<IType> types); |
| 31 | + TNextElement DependOnAny(IEnumerable<Type> types); |
| 32 | + ShouldRelateToTypesThat<TNextElement, TRuleType> DependOnAnyTypesThat(); |
| 33 | + |
| 34 | + TNextElement FollowCustomCondition(ICondition<TRuleType> condition); |
| 35 | + TNextElement FollowCustomCondition(Func<TRuleType, ConditionResult> condition, string description); |
| 36 | + TNextElement FollowCustomCondition(Func<TRuleType, bool> condition, string description, string failDescription); |
| 37 | + |
| 38 | + TNextElement OnlyDependOn(); |
| 39 | + TNextElement OnlyDependOn(params IType[] types); |
| 40 | + TNextElement OnlyDependOn(params Type[] types); |
| 41 | + TNextElement OnlyDependOn(IObjectProvider<IType> types); |
| 42 | + TNextElement OnlyDependOn(IEnumerable<IType> types); |
| 43 | + TNextElement OnlyDependOn(IEnumerable<Type> types); |
| 44 | + ShouldRelateToTypesThat<TNextElement, TRuleType> OnlyDependOnTypesThat(); |
| 45 | + |
| 46 | + TNextElement HaveAnyAttributes(); |
| 47 | + TNextElement HaveAnyAttributes(params Attribute[] attributes); |
| 48 | + TNextElement HaveAnyAttributes(params Type[] attributes); |
| 49 | + TNextElement HaveAnyAttributes(IObjectProvider<Attribute> attributes); |
| 50 | + TNextElement HaveAnyAttributes(IEnumerable<Attribute> attributes); |
| 51 | + TNextElement HaveAnyAttributes(IEnumerable<Type> attributes); |
| 52 | + ShouldRelateToAttributesThat<TNextElement, TRuleType> HaveAnyAttributesThat(); |
| 53 | + |
| 54 | + TNextElement OnlyHaveAttributes(); |
| 55 | + TNextElement OnlyHaveAttributes(params Attribute[] attributes); |
| 56 | + TNextElement OnlyHaveAttributes(params Type[] attributes); |
| 57 | + TNextElement OnlyHaveAttributes(IObjectProvider<Attribute> attributes); |
| 58 | + TNextElement OnlyHaveAttributes(IEnumerable<Attribute> attributes); |
| 59 | + TNextElement OnlyHaveAttributes(IEnumerable<Type> attributes); |
| 60 | + ShouldRelateToAttributesThat<TNextElement, TRuleType> OnlyHaveAttributesThat(); |
| 61 | + |
| 62 | + TNextElement HaveAnyAttributesWithArguments(IEnumerable<object> argumentValues); |
| 63 | + |
| 64 | + TNextElement HaveAttributeWithArguments(Attribute attribute, IEnumerable<object> argumentValues); |
| 65 | + TNextElement HaveAttributeWithArguments(Type attribute, IEnumerable<object> argumentValues); |
| 66 | + |
| 67 | + TNextElement HaveAnyAttributesWithNamedArguments(IEnumerable<(string, object)> attributeArguments); |
| 68 | + TNextElement HaveAnyAttributesWithNamedArguments(params (string, object)[] attributeArguments); |
| 69 | + |
| 70 | + TNextElement HaveAttributeWithNamedArguments(Attribute attribute, IEnumerable<(string, object)> attributeArguments); |
| 71 | + TNextElement HaveAttributeWithNamedArguments(Attribute attribute, params (string, object)[] attributeArguments); |
| 72 | + TNextElement HaveAttributeWithNamedArguments(Type attribute, IEnumerable<(string, object)> attributeArguments); |
| 73 | + TNextElement HaveAttributeWithNamedArguments(Type attribute, params (string, object)[] attributeArguments); |
| 74 | + |
| 75 | + TNextElement HaveName(string name); |
| 76 | + TNextElement HaveNameMatching(string pattern); |
| 77 | + TNextElement HaveNameStartingWith(string pattern); |
| 78 | + TNextElement HaveNameEndingWith(string pattern); |
| 79 | + TNextElement HaveNameContaining(string pattern); |
| 80 | + |
| 81 | + TNextElement HaveFullName(string fullName); |
| 82 | + TNextElement HaveFullNameMatching(string pattern); |
| 83 | + TNextElement HaveFullNameStartingWith(string pattern); |
| 84 | + TNextElement HaveFullNameEndingWith(string pattern); |
| 85 | + TNextElement HaveFullNameContaining(string pattern); |
| 86 | + |
| 87 | + TNextElement HaveAssemblyQualifiedName(string assemblyQualifiedName); |
| 88 | + TNextElement HaveAssemblyQualifiedNameMatching(string pattern); |
| 89 | + TNextElement HaveAssemblyQualifiedNameStartingWith(string pattern); |
| 90 | + TNextElement HaveAssemblyQualifiedNameEndingWith(string pattern); |
| 91 | + TNextElement HaveAssemblyQualifiedNameContaining(string pattern); |
| 92 | + |
| 93 | + TNextElement BePrivate(); |
| 94 | + TNextElement BePublic(); |
| 95 | + TNextElement BeProtected(); |
| 96 | + TNextElement BeInternal(); |
| 97 | + TNextElement BeProtectedInternal(); |
| 98 | + TNextElement BePrivateProtected(); |
| 99 | + |
| 100 | + //Negations |
| 101 | + |
| 102 | + TNextElement NotExist(); |
| 103 | + |
| 104 | + TNextElement NotBe(params ICanBeAnalyzed[] objects); |
| 105 | + TNextElement NotBe(IEnumerable<ICanBeAnalyzed> objects); |
| 106 | + TNextElement NotBe(IObjectProvider<ICanBeAnalyzed> objects); |
| 107 | + |
| 108 | + TNextElement NotCallAny(params MethodMember[] methods); |
| 109 | + TNextElement NotCallAny(IEnumerable<MethodMember> methods); |
| 110 | + TNextElement NotCallAny(IObjectProvider<MethodMember> methods); |
| 111 | + |
| 112 | + TNextElement NotDependOnAny(); |
| 113 | + TNextElement NotDependOnAny(params IType[] types); |
| 114 | + TNextElement NotDependOnAny(params Type[] types); |
| 115 | + TNextElement NotDependOnAny(IObjectProvider<IType> types); |
| 116 | + TNextElement NotDependOnAny(IEnumerable<IType> types); |
| 117 | + TNextElement NotDependOnAny(IEnumerable<Type> types); |
| 118 | + ShouldRelateToTypesThat<TNextElement, TRuleType> NotDependOnAnyTypesThat(); |
| 119 | + |
| 120 | + TNextElement NotHaveAnyAttributes(); |
| 121 | + TNextElement NotHaveAnyAttributes(params Attribute[] attributes); |
| 122 | + TNextElement NotHaveAnyAttributes(params Type[] attributes); |
| 123 | + TNextElement NotHaveAnyAttributes(IObjectProvider<Attribute> attributes); |
| 124 | + TNextElement NotHaveAnyAttributes(IEnumerable<Attribute> attributes); |
| 125 | + TNextElement NotHaveAnyAttributes(IEnumerable<Type> attributes); |
| 126 | + ShouldRelateToAttributesThat<TNextElement, TRuleType> NotHaveAnyAttributesThat(); |
| 127 | + |
| 128 | + TNextElement NotHaveAnyAttributesWithArguments(IEnumerable<object> argumentValues); |
| 129 | + |
| 130 | + TNextElement NotHaveAttributeWithArguments(Attribute attribute, IEnumerable<object> argumentValues); |
| 131 | + TNextElement NotHaveAttributeWithArguments(Type attribute, IEnumerable<object> argumentValues); |
| 132 | + |
| 133 | + TNextElement NotHaveAnyAttributesWithNamedArguments(IEnumerable<(string, object)> attributeArguments); |
| 134 | + TNextElement NotHaveAnyAttributesWithNamedArguments(params (string, object)[] attributeArguments); |
| 135 | + |
| 136 | + TNextElement NotHaveAttributeWithNamedArguments(Attribute attribute, IEnumerable<(string, object)> attributeArguments); |
| 137 | + TNextElement NotHaveAttributeWithNamedArguments(Attribute attribute, params (string, object)[] attributeArguments); |
| 138 | + TNextElement NotHaveAttributeWithNamedArguments(Type attribute, IEnumerable<(string, object)> attributeArguments); |
| 139 | + TNextElement NotHaveAttributeWithNamedArguments(Type attribute, params (string, object)[] attributeArguments); |
| 140 | + |
| 141 | + TNextElement NotHaveName(string name); |
| 142 | + TNextElement NotHaveNameMatching(string pattern); |
| 143 | + TNextElement NotHaveNameStartingWith(string pattern); |
| 144 | + TNextElement NotHaveNameEndingWith(string pattern); |
| 145 | + TNextElement NotHaveNameContaining(string pattern); |
| 146 | + |
| 147 | + TNextElement NotHaveFullName(string fullName); |
| 148 | + TNextElement NotHaveFullNameMatching(string pattern); |
| 149 | + TNextElement NotHaveFullNameStartingWith(string pattern); |
| 150 | + TNextElement NotHaveFullNameEndingWith(string pattern); |
| 151 | + TNextElement NotHaveFullNameContaining(string pattern); |
| 152 | + |
| 153 | + TNextElement NotHaveAssemblyQualifiedName(string assemblyQualifiedName); |
| 154 | + TNextElement NotHaveAssemblyQualifiedNameMatching(string pattern); |
| 155 | + TNextElement NotHaveAssemblyQualifiedNameStartingWith(string pattern); |
| 156 | + TNextElement NotHaveAssemblyQualifiedNameEndingWith(string pattern); |
| 157 | + TNextElement NotHaveAssemblyQualifiedNameContaining(string pattern); |
| 158 | + |
| 159 | + TNextElement NotBePrivate(); |
| 160 | + TNextElement NotBePublic(); |
| 161 | + TNextElement NotBeProtected(); |
| 162 | + TNextElement NotBeInternal(); |
| 163 | + TNextElement NotBeProtectedInternal(); |
| 164 | + TNextElement NotBePrivateProtected(); |
| 165 | + |
| 166 | + // csharpier-ignore-end |
| 167 | + } |
| 168 | +} |
0 commit comments