File tree Expand file tree Collapse file tree
ConventionTests/Conventions/Internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11namespace ConventionTests
22{
3+ using System . ComponentModel ;
34 using ApprovalTests ;
45
56 public abstract class ConventionTestBase : IConventionTest
67 {
78 public virtual string Name
89 {
9- get { return GetType ( ) . Name . Replace ( '_' , ' ' ) ; }
10+ get
11+ {
12+ var descriptions = GetType ( ) . GetCustomAttributes ( typeof ( DescriptionAttribute ) , false ) ;
13+ if ( descriptions . Length == 1 )
14+ {
15+ return ( ( DescriptionAttribute ) descriptions [ 0 ] ) . Description ;
16+ }
17+ return GetType ( ) . Name . Replace ( '_' , ' ' ) ;
18+ }
1019 }
1120
1221 public abstract void Execute ( IAssert assert ) ;
1322
1423 protected void Approve ( string message )
1524 {
16- Approvals . Verify ( new ApprovalTextWriter ( message ) , new ConventionTestNamer ( GetType ( ) . Name ) ,
25+ Approvals . Verify ( new ApprovalTextWriter ( message ) ,
26+ new ConventionTestNamer ( GetType ( ) . Name ) ,
1727 Approvals . GetReporter ( ) ) ;
1828 }
1929 }
You can’t perform that action at this time.
0 commit comments