Skip to content

Commit 71e51bf

Browse files
committed
refactoring
1 parent 1f95218 commit 71e51bf

File tree

7 files changed

+146
-131
lines changed

7 files changed

+146
-131
lines changed

src/NetArchTest.Rules/Assemblies/TypeWrapper.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ internal TypeWrapper(TypeDefinition monoTypeDefinition, string explanation)
1717
{
1818
_monoTypeDefinition = monoTypeDefinition;
1919
_type = new Lazy<Type>(() =>
20-
{
21-
Type type = null;
20+
{
2221
try
2322
{
24-
type = _monoTypeDefinition.ToType();
23+
return _monoTypeDefinition.ToType();
2524
}
26-
catch { }
27-
return type;
25+
catch
26+
{
27+
}
28+
return null;
2829
});
2930
Explanation = explanation;
3031
}

src/NetArchTest.Rules/Condition.cs

Lines changed: 61 additions & 55 deletions
Large diffs are not rendered by default.

src/NetArchTest.Rules/Functions/FunctionDelegates.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace NetArchTest.Functions
1414
{
1515
internal static partial class FunctionDelegates
1616
{
17-
public static IEnumerable<TypeSpec> HaveName(IEnumerable<TypeSpec> input, string name, bool condition)
17+
internal static IEnumerable<TypeSpec> HaveName(IEnumerable<TypeSpec> input, string name, bool condition)
1818
{
1919
if (condition)
2020
{
@@ -140,7 +140,7 @@ internal static IEnumerable<TypeSpec> ImplementsInterface(IEnumerable<TypeSpec>
140140
}
141141

142142
/// <summary> Function for finding abstract classes. </summary>
143-
internal static IEnumerable<TypeSpec> BeAbstract(IEnumerable<TypeSpec> input, bool dummy, bool condition)
143+
internal static IEnumerable<TypeSpec> BeAbstract(IEnumerable<TypeSpec> input, bool condition)
144144
{
145145
if (condition)
146146
{
@@ -153,7 +153,7 @@ internal static IEnumerable<TypeSpec> BeAbstract(IEnumerable<TypeSpec> input, bo
153153
}
154154

155155
/// <summary> Function for finding classes. </summary>
156-
internal static IEnumerable<TypeSpec> BeClass(IEnumerable<TypeSpec> input, bool dummy, bool condition)
156+
internal static IEnumerable<TypeSpec> BeClass(IEnumerable<TypeSpec> input, bool condition)
157157
{
158158
if (condition)
159159
{
@@ -166,7 +166,7 @@ internal static IEnumerable<TypeSpec> BeClass(IEnumerable<TypeSpec> input, bool
166166
}
167167

168168
/// <summary> Function for finding interfaces. </summary>
169-
internal static IEnumerable<TypeSpec> BeInterface(IEnumerable<TypeSpec> input, bool dummy, bool condition)
169+
internal static IEnumerable<TypeSpec> BeInterface(IEnumerable<TypeSpec> input, bool condition)
170170
{
171171
if (condition)
172172
{
@@ -179,7 +179,7 @@ internal static IEnumerable<TypeSpec> BeInterface(IEnumerable<TypeSpec> input, b
179179
}
180180

181181
/// <summary> Function for finding static classes. </summary>
182-
internal static IEnumerable<TypeSpec> BeStatic(IEnumerable<TypeSpec> input, bool dummy, bool condition)
182+
internal static IEnumerable<TypeSpec> BeStatic(IEnumerable<TypeSpec> input, bool condition)
183183
{
184184
if (condition)
185185
{
@@ -194,7 +194,7 @@ internal static IEnumerable<TypeSpec> BeStatic(IEnumerable<TypeSpec> input, bool
194194
}
195195

196196
/// <summary> Function for finding types with generic parameters. </summary>
197-
internal static IEnumerable<TypeSpec> BeGeneric(IEnumerable<TypeSpec> input, bool dummy, bool condition)
197+
internal static IEnumerable<TypeSpec> BeGeneric(IEnumerable<TypeSpec> input, bool condition)
198198
{
199199
if (condition)
200200
{
@@ -208,7 +208,7 @@ internal static IEnumerable<TypeSpec> BeGeneric(IEnumerable<TypeSpec> input, boo
208208

209209

210210
/// <summary> Function for finding nested classes. </summary>
211-
internal static IEnumerable<TypeSpec> BeNested(IEnumerable<TypeSpec> input, bool dummy, bool condition)
211+
internal static IEnumerable<TypeSpec> BeNested(IEnumerable<TypeSpec> input, bool condition)
212212
{
213213
if (condition)
214214
{
@@ -221,7 +221,7 @@ internal static IEnumerable<TypeSpec> BeNested(IEnumerable<TypeSpec> input, bool
221221
}
222222

223223
/// <summary> Function for finding nested public classes. </summary>
224-
internal static IEnumerable<TypeSpec> BeNestedPublic(IEnumerable<TypeSpec> input, bool dummy, bool condition)
224+
internal static IEnumerable<TypeSpec> BeNestedPublic(IEnumerable<TypeSpec> input, bool condition)
225225
{
226226
if (condition)
227227
{
@@ -234,7 +234,7 @@ internal static IEnumerable<TypeSpec> BeNestedPublic(IEnumerable<TypeSpec> input
234234
}
235235

236236
/// <summary> Function for finding nested private classes. </summary>
237-
internal static IEnumerable<TypeSpec> BeNestedPrivate(IEnumerable<TypeSpec> input, bool dummy, bool condition)
237+
internal static IEnumerable<TypeSpec> BeNestedPrivate(IEnumerable<TypeSpec> input, bool condition)
238238
{
239239
if (condition)
240240
{
@@ -248,7 +248,7 @@ internal static IEnumerable<TypeSpec> BeNestedPrivate(IEnumerable<TypeSpec> inpu
248248

249249

250250
/// <summary> Function for finding public classes. </summary>
251-
internal static IEnumerable<TypeSpec> BePublic(IEnumerable<TypeSpec> input, bool dummy, bool condition)
251+
internal static IEnumerable<TypeSpec> BePublic(IEnumerable<TypeSpec> input, bool condition)
252252
{
253253
if (condition)
254254
{
@@ -261,7 +261,7 @@ internal static IEnumerable<TypeSpec> BePublic(IEnumerable<TypeSpec> input, bool
261261
}
262262

263263
/// <summary> Function for finding sealed classes. </summary>
264-
internal static IEnumerable<TypeSpec> BeSealed(IEnumerable<TypeSpec> input, bool dummmy, bool condition)
264+
internal static IEnumerable<TypeSpec> BeSealed(IEnumerable<TypeSpec> input, bool condition)
265265
{
266266
if (condition)
267267
{
@@ -274,7 +274,7 @@ internal static IEnumerable<TypeSpec> BeSealed(IEnumerable<TypeSpec> input, bool
274274
}
275275

276276
/// <summary> Function for finding immutable classes. </summary>
277-
internal static IEnumerable<TypeSpec> BeImmutable(IEnumerable<TypeSpec> input, bool dummmy, bool condition)
277+
internal static IEnumerable<TypeSpec> BeImmutable(IEnumerable<TypeSpec> input, bool condition)
278278
{
279279
if (condition)
280280
{
@@ -287,7 +287,7 @@ internal static IEnumerable<TypeSpec> BeImmutable(IEnumerable<TypeSpec> input, b
287287
}
288288

289289
/// <summary> Function for finding nullable classes. </summary>
290-
internal static IEnumerable<TypeSpec> HasNullableMembers(IEnumerable<TypeSpec> input, bool dummmy, bool condition)
290+
internal static IEnumerable<TypeSpec> HasNullableMembers(IEnumerable<TypeSpec> input, bool condition)
291291
{
292292
if (condition)
293293
{

src/NetArchTest.Rules/IType.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public interface IType
2525
/// </summary>
2626
string Name { get; }
2727

28-
28+
/// <summary>
29+
/// It contains explanation why this Type has failed dependecy search.
30+
/// </summary>
2931
string Explanation { get; }
3032
}
3133
}

0 commit comments

Comments
 (0)