File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
TestStack.ConventionTests/Reporting Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
namespace TestStack . ConventionTests . Reporting
2
2
{
3
3
using System ;
4
+ using TestStack . ConventionTests . ConventionData ;
4
5
5
6
public class TypeDataFormatter : IReportDataFormatter
6
7
{
@@ -11,16 +12,15 @@ public bool CanFormat(object data)
11
12
12
13
public string FormatString ( object data )
13
14
{
14
- return ( ( Type ) data ) . FullName ;
15
+ return ( ( Type ) data ) . ToTypeNameString ( ) ;
15
16
}
16
17
17
18
public string FormatHtml ( object data )
18
19
{
19
20
var type = ( ( Type ) data ) ;
20
- var ns = type . Namespace ;
21
- if ( ns == null )
22
- return type . Name ;
23
- return string . Format ( "{0}.<strong>{1}</strong>" , ns , type . Name ) ;
21
+ var oldValue = string . Format ( "{0}." , type . Namespace ) ;
22
+ var newValue = string . Format ( "{0}.<strong>" , type . Namespace ) ;
23
+ return string . Format ( "{0}</strong>" , FormatString ( data ) . Replace ( oldValue , newValue ) ) ;
24
24
}
25
25
}
26
26
}
You can’t perform that action at this time.
0 commit comments