44 using System . Collections . Generic ;
55 using System . IO ;
66 using System . Reflection ;
7- using ApprovalTests ;
8- using ApprovalTests . Core . Exceptions ;
97 using TestStack . ConventionTests . Internal ;
108 using TestStack . ConventionTests . Reporting ;
119
@@ -35,7 +33,8 @@ public static void Is<TDataSource>(IConvention<TDataSource> convention, TDataSou
3533 Is ( convention , data , new ThrowOnFailureResultsProcessor ( ) ) ;
3634 }
3735
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 )
3938 where TDataSource : IConventionData
4039 {
4140 try
@@ -45,7 +44,7 @@ public static void Is<TDataSource>(IConvention<TDataSource> convention, TDataSou
4544 Reports . AddRange ( conventionResult ) ;
4645
4746 new ConventionReportTraceRenderer ( ) . Process ( conventionResult ) ;
48- reporter . Process ( conventionResult ) ;
47+ processor . Process ( conventionResult ) ;
4948 }
5049 finally
5150 {
@@ -56,26 +55,7 @@ public static void Is<TDataSource>(IConvention<TDataSource> convention, TDataSou
5655 public static void IsWithApprovedExeptions < TDataSource > ( IConvention < TDataSource > convention , TDataSource data )
5756 where TDataSource : IConventionData
5857 {
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 ( ) ) ;
7959 }
8060
8161 // http://stackoverflow.com/questions/52797/c-how-do-i-get-the-path-of-the-assembly-the-code-is-in#answer-283917
0 commit comments