4
4
using System . Collections . Generic ;
5
5
using System . IO ;
6
6
using System . Reflection ;
7
- using ApprovalTests ;
8
- using ApprovalTests . Core . Exceptions ;
9
7
using TestStack . ConventionTests . Internal ;
10
8
using TestStack . ConventionTests . Reporting ;
11
9
@@ -35,7 +33,8 @@ public static void Is<TDataSource>(IConvention<TDataSource> convention, TDataSou
35
33
Is ( convention , data , new ThrowOnFailureResultsProcessor ( ) ) ;
36
34
}
37
35
38
- public static void Is < TDataSource > ( IConvention < TDataSource > convention , TDataSource data , IResultsProcessor reporter )
36
+ public static void Is < TDataSource > ( IConvention < TDataSource > convention , TDataSource data ,
37
+ IResultsProcessor processor )
39
38
where TDataSource : IConventionData
40
39
{
41
40
try
@@ -45,7 +44,7 @@ public static void Is<TDataSource>(IConvention<TDataSource> convention, TDataSou
45
44
Reports . AddRange ( conventionResult ) ;
46
45
47
46
new ConventionReportTraceRenderer ( ) . Process ( conventionResult ) ;
48
- reporter . Process ( conventionResult ) ;
47
+ processor . Process ( conventionResult ) ;
49
48
}
50
49
finally
51
50
{
@@ -56,26 +55,7 @@ public static void Is<TDataSource>(IConvention<TDataSource> convention, TDataSou
56
55
public static void IsWithApprovedExeptions < TDataSource > ( IConvention < TDataSource > convention , TDataSource data )
57
56
where TDataSource : IConventionData
58
57
{
59
- var context = new ConventionContext ( data . Description , Formatters ) ;
60
- var conventionResult = context . Execute ( convention , data ) ;
61
- Reports . AddRange ( conventionResult ) ;
62
-
63
- try
64
- {
65
- var conventionReportTextRenderer = new ConventionReportTextRenderer ( ) ;
66
- conventionReportTextRenderer . Process ( conventionResult ) ;
67
- Approvals . Verify ( conventionReportTextRenderer . Output ) ;
68
-
69
- new ConventionReportTraceRenderer ( ) . Process ( conventionResult ) ;
70
- }
71
- catch ( ApprovalException ex )
72
- {
73
- throw new ConventionFailedException ( "Approved exceptions for convention differs\r \n \r \n " + ex . Message , ex ) ;
74
- }
75
- finally
76
- {
77
- HtmlRenderer . Process ( Reports . ToArray ( ) ) ;
78
- }
58
+ Is ( convention , data , new ApproveResultsProcessor ( ) ) ;
79
59
}
80
60
81
61
// http://stackoverflow.com/questions/52797/c-how-do-i-get-the-path-of-the-assembly-the-code-is-in#answer-283917
0 commit comments