Skip to content

Commit a9f1d0e

Browse files
committed
unified all conventiondata types to have WithApprovedExceptions method
1 parent 88e1bc9 commit a9f1d0e

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

ConventionTests/Conventions/Internal/ConventionTest.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ protected virtual Type[] GetTypesToTest(ConventionData data)
6262
return data.SourceTypes;
6363
}
6464

65-
return
66-
GetAssembliesToScan(data).SelectMany(a => a.SafeGetTypes()).Where(data.Types.Invoke).OrderBy(
67-
t => t.FullName)
68-
.ToArray();
65+
return GetAssembliesToScan(data)
66+
.SelectMany(a => a.SafeGetTypes())
67+
.Where(data.Types.Invoke)
68+
.OrderBy(t => t.FullName)
69+
.ToArray();
6970
}
7071
}
7172
}

ConventionTests/Conventions/Internal/WindsorConventionData.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public IWindsorContainer Container
3232
public string Description { get; set; }
3333

3434
public bool HasApprovedExceptions { get; set; }
35+
36+
/// <summary>
37+
/// helper method to set <see cref="HasApprovedExceptions" /> in a more convenient manner.
38+
/// </summary>
39+
/// <returns> </returns>
40+
public WindsorConventionData WithApprovedExceptions(string explanation = null)
41+
{
42+
HasApprovedExceptions = true;
43+
return this;
44+
}
3545
}
3646

3747
public class WindsorConventionData<TDiagnosticData>
@@ -62,5 +72,15 @@ public IWindsorContainer Container
6272
public bool HasApprovedExceptions { get; set; }
6373

6474
public Func<TDiagnosticData, object> OrderBy { get; set; }
75+
76+
/// <summary>
77+
/// helper method to set <see cref="HasApprovedExceptions" /> in a more convenient manner.
78+
/// </summary>
79+
/// <returns> </returns>
80+
public WindsorConventionData<TDiagnosticData> WithApprovedExceptions(string explanation = null)
81+
{
82+
HasApprovedExceptions = true;
83+
return this;
84+
}
6585
}
6686
}

0 commit comments

Comments
 (0)