This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
test/GitHub.VisualStudio.UnitTests Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 2121 <ItemGroup >
2222 <PackageReference Include =" Codecov" Version =" 1.1.0" />
2323 <PackageReference Include =" Madskristensen.VisualStudio.SDK" Version =" 14.3.75-pre" />
24+ <PackageReference Include =" NCrunch.Framework" Version =" 3.17.0" />
2425 <PackageReference Include =" NSubstitute" Version =" 2.0.3" />
2526 <PackageReference Include =" NUnit" version =" 3.9.0" />
2627 <PackageReference Include =" OpenCover" Version =" 4.6.519" />
Original file line number Diff line number Diff line change 11using System ;
22using System . IO ;
3+ using System . Linq ;
34using System . Reflection ;
5+ using NCrunch . Framework ;
46using NUnit . Framework ;
57
68public class GitHubAssemblyTests
@@ -30,7 +32,20 @@ public void GitHub_Assembly_Should_Not_Reference_System_Net_Http_Above_4_0(strin
3032 }
3133
3234 [ DatapointSource ]
33- string [ ] GitHubAssemblies => Directory . GetFiles ( AssemblyDirectory , "GitHub.*.dll" ) ;
35+ string [ ] GetGitHubAssemblies ( )
36+ {
37+ var prefix = "GitHub." ;
38+ if ( NCrunchEnvironment . NCrunchIsResident ( ) )
39+ {
40+ return NCrunchEnvironment . GetAllAssemblyLocations ( )
41+ . Where ( p => Path . GetFileName ( p ) . StartsWith ( prefix , StringComparison . OrdinalIgnoreCase ) )
42+ . ToArray ( ) ;
43+ }
44+ else
45+ {
46+ var dir = Path . GetDirectoryName ( GetType ( ) . Assembly . Location ) ;
47+ return Directory . GetFiles ( dir , $ "{ prefix } *.dll") ;
48+ }
49+ }
3450
35- string AssemblyDirectory => Path . GetDirectoryName ( GetType ( ) . Assembly . Location ) ;
3651}
You can’t perform that action at this time.
0 commit comments