@@ -124,6 +124,7 @@ public void CanReadBooleanValue()
124124 using ( var repo = new Repository ( StandardTestRepoPath ) )
125125 {
126126 Assert . True ( repo . Config . Get < bool > ( "core.ignorecase" ) ) ;
127+ Assert . Equal ( true , repo . Config . Get < bool ? > ( "core.ignorecase" ) ) ;
127128 }
128129 }
129130
@@ -133,6 +134,7 @@ public void CanReadIntValue()
133134 using ( var repo = new Repository ( StandardTestRepoPath ) )
134135 {
135136 Assert . Equal ( 2 , repo . Config . Get < int > ( "unittests.intsetting" ) ) ;
137+ Assert . Equal ( 2 , repo . Config . Get < int ? > ( "unittests.intsetting" ) ) ;
136138 }
137139 }
138140
@@ -142,6 +144,7 @@ public void CanReadLongValue()
142144 using ( var repo = new Repository ( StandardTestRepoPath ) )
143145 {
144146 Assert . Equal ( 15234 , repo . Config . Get < long > ( "unittests.longsetting" ) ) ;
147+ Assert . Equal ( 15234 , repo . Config . Get < long ? > ( "unittests.longsetting" ) ) ;
145148 }
146149 }
147150
@@ -320,12 +323,18 @@ public void ReadingValueThatDoesntExistReturnsDefault()
320323 {
321324 Assert . Null ( repo . Config . Get < string > ( "unittests.ghostsetting" ) ) ;
322325 Assert . Equal ( 0 , repo . Config . Get < int > ( "unittests.ghostsetting" ) ) ;
326+ Assert . Null ( repo . Config . Get < int ? > ( "unittests.ghostsetting" ) ) ;
323327 Assert . Equal ( 0L , repo . Config . Get < long > ( "unittests.ghostsetting" ) ) ;
328+ Assert . Null ( repo . Config . Get < long ? > ( "unittests.ghostsetting" ) ) ;
324329 Assert . False ( repo . Config . Get < bool > ( "unittests.ghostsetting" ) ) ;
330+ Assert . Null ( repo . Config . Get < bool ? > ( "unittests.ghostsetting" ) ) ;
325331 Assert . Equal ( "42" , repo . Config . Get ( "unittests.ghostsetting" , "42" ) ) ;
326332 Assert . Equal ( 42 , repo . Config . Get ( "unittests.ghostsetting" , 42 ) ) ;
333+ Assert . Equal ( 42 , repo . Config . Get < int ? > ( "unittests.ghostsetting" , 42 ) ) ;
327334 Assert . Equal ( 42L , repo . Config . Get ( "unittests.ghostsetting" , 42L ) ) ;
335+ Assert . Equal ( 42L , repo . Config . Get < long ? > ( "unittests.ghostsetting" , 42L ) ) ;
328336 Assert . True ( repo . Config . Get ( "unittests.ghostsetting" , true ) ) ;
337+ Assert . Equal ( true , repo . Config . Get < bool ? > ( "unittests.ghostsetting" , true ) ) ;
329338 }
330339 }
331340
0 commit comments