4
4
using System . Linq ;
5
5
using LibGit2Sharp . Tests . TestHelpers ;
6
6
using Xunit ;
7
- using Xunit . Extensions ;
8
7
9
8
namespace LibGit2Sharp . Tests
10
9
{
@@ -56,9 +55,7 @@ public void CanAddAndReadMultivarFromTheLocalConfiguration()
56
55
string path = SandboxStandardTestRepo ( ) ;
57
56
using ( var repo = new Repository ( path ) )
58
57
{
59
- Assert . Empty ( repo . Config
60
- . OfType < ConfigurationEntry < string > > ( )
61
- . Where ( x => x . Key == "unittests.plugin" ) ) ;
58
+ Assert . DoesNotContain ( repo . Config . OfType < ConfigurationEntry < string > > ( ) , x => x . Key == "unittests.plugin" ) ;
62
59
63
60
repo . Config . Add ( "unittests.plugin" , "value1" , ConfigurationLevel . Local ) ;
64
61
repo . Config . Add ( "unittests.plugin" , "value2" , ConfigurationLevel . Local ) ;
@@ -78,9 +75,7 @@ public void CanAddAndReadMultivarFromTheGlobalConfiguration()
78
75
using ( var repo = new Repository ( path ) )
79
76
{
80
77
Assert . True ( repo . Config . HasConfig ( ConfigurationLevel . Global ) ) ;
81
- Assert . Empty ( repo . Config
82
- . OfType < ConfigurationEntry < string > > ( )
83
- . Where ( x => x . Key == "unittests.plugin" ) ) ;
78
+ Assert . DoesNotContain ( repo . Config . OfType < ConfigurationEntry < string > > ( ) , x => x . Key == "unittests.plugin" ) ;
84
79
85
80
repo . Config . Add ( "unittests.plugin" , "value1" , ConfigurationLevel . Global ) ;
86
81
repo . Config . Add ( "unittests.plugin" , "value2" , ConfigurationLevel . Global ) ;
@@ -157,9 +152,7 @@ public void CanUnsetAllFromTheLocalConfiguration()
157
152
158
153
repo . Config . UnsetAll ( "unittests.plugin" ) ;
159
154
160
- Assert . Empty ( repo . Config
161
- . OfType < ConfigurationEntry < string > > ( )
162
- . Where ( x => x . Key == "unittests.plugin" ) ) ;
155
+ Assert . DoesNotContain ( repo . Config . OfType < ConfigurationEntry < string > > ( ) , x => x . Key == "unittests.plugin" ) ;
163
156
}
164
157
}
165
158
@@ -531,20 +524,20 @@ public void CanSetAndGetSearchPath()
531
524
{
532
525
string globalPath = Path . Combine ( Constants . TemporaryReposPath , Path . GetRandomFileName ( ) ) ;
533
526
string systemPath = Path . Combine ( Constants . TemporaryReposPath , Path . GetRandomFileName ( ) ) ;
534
- string xdgPath = Path . Combine ( Constants . TemporaryReposPath , Path . GetRandomFileName ( ) ) ;
527
+ string xdgPath = Path . Combine ( Constants . TemporaryReposPath , Path . GetRandomFileName ( ) ) ;
535
528
536
529
GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Global , globalPath ) ;
537
530
GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . System , systemPath ) ;
538
- GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Xdg , xdgPath ) ;
531
+ GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Xdg , xdgPath ) ;
539
532
540
533
Assert . Equal ( globalPath , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Global ) . Single ( ) ) ;
541
534
Assert . Equal ( systemPath , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . System ) . Single ( ) ) ;
542
- Assert . Equal ( xdgPath , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Xdg ) . Single ( ) ) ;
535
+ Assert . Equal ( xdgPath , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Xdg ) . Single ( ) ) ;
543
536
544
537
// reset the search paths to their defaults
545
538
GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Global , null ) ;
546
539
GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . System , null ) ;
547
- GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Xdg , null ) ;
540
+ GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Xdg , null ) ;
548
541
}
549
542
550
543
[ Fact ]
@@ -577,12 +570,12 @@ public void CanResetSearchPaths()
577
570
var newPaths = new string [ ] { Path . Combine ( Constants . TemporaryReposPath , Path . GetRandomFileName ( ) ) } ;
578
571
579
572
// change to the non-default path
580
- GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Global , newPaths ) ;
581
- Assert . Equal ( newPaths , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Global ) ) ;
573
+ GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Global , newPaths ) ;
574
+ Assert . Equal ( newPaths , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Global ) ) ;
582
575
583
576
// set it back to the default
584
- GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Global , null ) ;
585
- Assert . Equal ( oldPaths , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Global ) ) ;
577
+ GlobalSettings . SetConfigSearchPaths ( ConfigurationLevel . Global , null ) ;
578
+ Assert . Equal ( oldPaths , GlobalSettings . GetConfigSearchPaths ( ConfigurationLevel . Global ) ) ;
586
579
}
587
580
588
581
[ Fact ]
0 commit comments