1
- namespace TestStack . ConventionTests . Internal
2
- {
3
- using TestStack . ConventionTests . Reporting ;
4
-
5
- public class ConventionResult
6
- {
7
- public TestResult Result { get ; private set ; }
8
- public string ConventionTitle { get ; private set ; }
9
- public string DataDescription { get ; private set ; }
10
- public ConventionReportFailure [ ] ConventionFailures { get ; private set ; }
11
- public string ApprovedException { get ; private set ; }
12
-
13
- public ConventionResult ( TestResult result , string conventionTitle , string dataDescription , ConventionReportFailure [ ] conventionFailures )
14
- {
15
- Result = result ;
16
- ConventionTitle = conventionTitle ;
17
- DataDescription = dataDescription ;
18
- ConventionFailures = conventionFailures ;
19
- }
20
-
21
- public void WithApprovedException ( string output )
22
- {
23
- ApprovedException = output ;
24
- Result = TestResult . Passed ;
25
- ConventionFailures = new ConventionReportFailure [ 0 ] ;
26
- }
27
- }
1
+ namespace TestStack . ConventionTests . Internal
2
+ {
3
+ using System . Linq ;
4
+ using TestStack . ConventionTests . Reporting ;
5
+
6
+ public class ConventionResult
7
+ {
8
+ public ConventionResult ( string conventionTitle , string dataDescription , ConventionReportFailure [ ] conventionFailures )
9
+ {
10
+ ConventionTitle = conventionTitle ;
11
+ DataDescription = dataDescription ;
12
+ ConventionFailures = conventionFailures ;
13
+ }
14
+
15
+ public TestResult Result
16
+ {
17
+ get
18
+ {
19
+ if ( ConventionFailures . Any ( ) )
20
+ {
21
+ return TestResult . Failed ;
22
+ }
23
+ return TestResult . Passed ;
24
+ }
25
+ }
26
+
27
+ public string ConventionTitle { get ; private set ; }
28
+ public string DataDescription { get ; private set ; }
29
+ public ConventionReportFailure [ ] ConventionFailures { get ; private set ; }
30
+ public string ApprovedException { get ; private set ; }
31
+ }
28
32
}
0 commit comments