File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . IO ;
3
3
using System . Linq ;
4
+ using System . Reflection ;
4
5
5
6
using GitVersion ;
6
7
7
8
using NUnit . Framework ;
8
9
9
10
using Shouldly ;
10
11
12
+ using YamlDotNet . Serialization ;
13
+
11
14
[ TestFixture ]
12
15
public class DocumentationTests
13
16
{
17
+ [ Test ]
18
+ public void ConfigurationDocumentationIsUpToDate ( )
19
+ {
20
+ var configurationDocumentationFile = ReadDocumentationFile ( "configuration.md" ) ;
21
+
22
+ const BindingFlags bindingFlags = BindingFlags . Public | BindingFlags . DeclaredOnly | BindingFlags . Instance ;
23
+ var configProperties = typeof ( Config )
24
+ . GetProperties ( bindingFlags )
25
+ . Union ( typeof ( BranchConfig ) . GetProperties ( bindingFlags ) )
26
+ . Select ( p => p . GetCustomAttribute < YamlMemberAttribute > ( ) )
27
+ . Where ( a => a != null )
28
+ . Select ( a => a . Alias )
29
+ . ToList ( ) ;
30
+
31
+ configProperties . ShouldNotBeEmpty ( ) ;
32
+
33
+ foreach ( var configProperty in configProperties )
34
+ {
35
+ var formattedConfigProperty = string . Format ( "**`{0}:`**" , configProperty ) ;
36
+ configurationDocumentationFile . ShouldContain ( formattedConfigProperty ,
37
+ Environment . NewLine + configurationDocumentationFile ) ;
38
+ }
39
+ }
40
+
41
+
14
42
[ Test ]
15
43
public void VariableDocumentationIsUpToDate ( )
16
44
{
You can’t perform that action at this time.
0 commit comments