@@ -11,19 +11,13 @@ public class MethodMembersShould
1111 public MethodMembersShould ( IArchRuleCreator < MethodMember > ruleCreator )
1212 : base ( ruleCreator ) { }
1313
14- public ShouldRelateToMethodMembersThat <
15- MethodMembersShouldConjunction ,
16- MethodMember
17- > BeMethodMembersThat ( )
14+ public ShouldRelateToMethodMembersThat < MethodMembersShouldConjunction , MethodMember > BeMethodMembersThat ( )
1815 {
1916 _ruleCreator . BeginComplexCondition (
2017 ArchRuleDefinition . MethodMembers ( ) ,
2118 MethodMemberConditionsDefinition . BeMethodMembersThat ( )
2219 ) ;
23- return new ShouldRelateToMethodMembersThat <
24- MethodMembersShouldConjunction ,
25- MethodMember
26- > ( _ruleCreator ) ;
20+ return new ShouldRelateToMethodMembersThat < MethodMembersShouldConjunction , MethodMember > ( _ruleCreator ) ;
2721 }
2822
2923 public MethodMembersShouldConjunction BeConstructor ( )
@@ -40,9 +34,7 @@ public MethodMembersShouldConjunction BeVirtual()
4034
4135 public MethodMembersShouldConjunction BeCalledBy ( IType firstType , params IType [ ] moreTypes )
4236 {
43- _ruleCreator . AddCondition (
44- MethodMemberConditionsDefinition . BeCalledBy ( firstType , moreTypes )
45- ) ;
37+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . BeCalledBy ( firstType , moreTypes ) ) ;
4638 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
4739 }
4840
@@ -70,62 +62,41 @@ public MethodMembersShouldConjunction BeCalledBy(IEnumerable<Type> types)
7062 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
7163 }
7264
73- public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo (
74- IType firstType ,
75- params IType [ ] moreTypes
76- )
65+ public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo ( IType firstType , params IType [ ] moreTypes )
7766 {
7867 _ruleCreator . AddCondition (
7968 MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( firstType , moreTypes )
8069 ) ;
8170 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
8271 }
8372
84- public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo (
85- Type type ,
86- params Type [ ] moreTypes
87- )
73+ public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo ( Type type , params Type [ ] moreTypes )
8874 {
89- _ruleCreator . AddCondition (
90- MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( type , moreTypes )
91- ) ;
75+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( type , moreTypes ) ) ;
9276 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
9377 }
9478
95- public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo (
96- IObjectProvider < IType > types
97- )
79+ public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo ( IObjectProvider < IType > types )
9880 {
99- _ruleCreator . AddCondition (
100- MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( types )
101- ) ;
81+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( types ) ) ;
10282 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
10383 }
10484
10585 public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo ( IEnumerable < IType > types )
10686 {
107- _ruleCreator . AddCondition (
108- MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( types )
109- ) ;
87+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( types ) ) ;
11088 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
11189 }
11290
11391 public MethodMembersShouldConjunction HaveDependencyInMethodBodyTo ( IEnumerable < Type > types )
11492 {
115- _ruleCreator . AddCondition (
116- MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( types )
117- ) ;
93+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveDependencyInMethodBodyTo ( types ) ) ;
11894 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
11995 }
12096
121- public MethodMembersShouldConjunction HaveReturnType (
122- IType firstType ,
123- params IType [ ] moreTypes
124- )
97+ public MethodMembersShouldConjunction HaveReturnType ( IType firstType , params IType [ ] moreTypes )
12598 {
126- _ruleCreator . AddCondition (
127- MethodMemberConditionsDefinition . HaveReturnType ( firstType , moreTypes )
128- ) ;
99+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveReturnType ( firstType , moreTypes ) ) ;
129100 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
130101 }
131102
@@ -143,9 +114,7 @@ public MethodMembersShouldConjunction HaveReturnType(IObjectProvider<IType> type
143114
144115 public MethodMembersShouldConjunction HaveReturnType ( Type type , params Type [ ] moreTypes )
145116 {
146- _ruleCreator . AddCondition (
147- MethodMemberConditionsDefinition . HaveReturnType ( type , moreTypes )
148- ) ;
117+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveReturnType ( type , moreTypes ) ) ;
149118 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
150119 }
151120
@@ -169,22 +138,15 @@ public MethodMembersShouldConjunction NotBeVirtual()
169138 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
170139 }
171140
172- public MethodMembersShouldConjunction NotBeCalledBy (
173- IType firstType ,
174- params IType [ ] moreTypes
175- )
141+ public MethodMembersShouldConjunction NotBeCalledBy ( IType firstType , params IType [ ] moreTypes )
176142 {
177- _ruleCreator . AddCondition (
178- MethodMemberConditionsDefinition . NotBeCalledBy ( firstType , moreTypes )
179- ) ;
143+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotBeCalledBy ( firstType , moreTypes ) ) ;
180144 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
181145 }
182146
183147 public MethodMembersShouldConjunction NotBeCalledBy ( Type type , params Type [ ] moreTypes )
184148 {
185- _ruleCreator . AddCondition (
186- MethodMemberConditionsDefinition . NotBeCalledBy ( type , moreTypes )
187- ) ;
149+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotBeCalledBy ( type , moreTypes ) ) ;
188150 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
189151 }
190152
@@ -206,69 +168,43 @@ public MethodMembersShouldConjunction NotBeCalledBy(IEnumerable<Type> types)
206168 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
207169 }
208170
209- public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo (
210- IType firstType ,
211- params IType [ ] moreTypes
212- )
171+ public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo ( IType firstType , params IType [ ] moreTypes )
213172 {
214173 _ruleCreator . AddCondition (
215- MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo (
216- firstType ,
217- moreTypes
218- )
174+ MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( firstType , moreTypes )
219175 ) ;
220176 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
221177 }
222178
223- public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo (
224- Type type ,
225- params Type [ ] moreTypes
226- )
179+ public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo ( Type type , params Type [ ] moreTypes )
227180 {
228181 _ruleCreator . AddCondition (
229182 MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( type , moreTypes )
230183 ) ;
231184 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
232185 }
233186
234- public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo (
235- IObjectProvider < IType > types
236- )
187+ public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo ( IObjectProvider < IType > types )
237188 {
238- _ruleCreator . AddCondition (
239- MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( types )
240- ) ;
189+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( types ) ) ;
241190 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
242191 }
243192
244- public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo (
245- IEnumerable < IType > types
246- )
193+ public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo ( IEnumerable < IType > types )
247194 {
248- _ruleCreator . AddCondition (
249- MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( types )
250- ) ;
195+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( types ) ) ;
251196 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
252197 }
253198
254- public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo (
255- IEnumerable < Type > types
256- )
199+ public MethodMembersShouldConjunction NotHaveDependencyInMethodBodyTo ( IEnumerable < Type > types )
257200 {
258- _ruleCreator . AddCondition (
259- MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( types )
260- ) ;
201+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveDependencyInMethodBodyTo ( types ) ) ;
261202 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
262203 }
263204
264- public MethodMembersShouldConjunction NotHaveReturnType (
265- IType firstType ,
266- params IType [ ] moreTypes
267- )
205+ public MethodMembersShouldConjunction NotHaveReturnType ( IType firstType , params IType [ ] moreTypes )
268206 {
269- _ruleCreator . AddCondition (
270- MethodMemberConditionsDefinition . NotHaveReturnType ( firstType , moreTypes )
271- ) ;
207+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveReturnType ( firstType , moreTypes ) ) ;
272208 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
273209 }
274210
@@ -286,9 +222,7 @@ public MethodMembersShouldConjunction NotHaveReturnType(IObjectProvider<IType> t
286222
287223 public MethodMembersShouldConjunction NotHaveReturnType ( Type type , params Type [ ] moreTypes )
288224 {
289- _ruleCreator . AddCondition (
290- MethodMemberConditionsDefinition . NotHaveReturnType ( type , moreTypes )
291- ) ;
225+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveReturnType ( type , moreTypes ) ) ;
292226 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
293227 }
294228
@@ -297,5 +231,17 @@ public MethodMembersShouldConjunction NotHaveReturnType(IEnumerable<Type> types)
297231 _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveReturnType ( types ) ) ;
298232 return new MethodMembersShouldConjunction ( _ruleCreator ) ;
299233 }
234+
235+ public MethodMembersShouldConjunction HaveAnyParameters ( )
236+ {
237+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . HaveAnyParameters ( ) ) ;
238+ return new MethodMembersShouldConjunction ( _ruleCreator ) ;
239+ }
240+
241+ public MethodMembersShouldConjunction NotHaveAnyParameters ( )
242+ {
243+ _ruleCreator . AddCondition ( MethodMemberConditionsDefinition . NotHaveAnyParameters ( ) ) ;
244+ return new MethodMembersShouldConjunction ( _ruleCreator ) ;
245+ }
300246 }
301247}
0 commit comments