1
1
using System . Threading ;
2
2
using FluentAssertions ;
3
3
using GitHub . Unity ;
4
+ using ICSharpCode . SharpZipLib . Zip ;
4
5
using NUnit . Framework ;
5
6
using Rackspace . Threading ;
6
7
using TestUtils ;
@@ -27,28 +28,28 @@ public void InstallGit()
27
28
{
28
29
environment . GitExecutablePath = gitSetup . GitExecutablePath ;
29
30
30
- setupDone . Should ( ) . BeTrue ( ) ;
31
- percent . Should ( ) . Be ( 1 ) ;
31
+ setupDone . Should ( ) . BeTrue ( ) ;
32
+ percent . Should ( ) . Be ( 1 ) ;
32
33
33
- Logger . Trace ( "Expected GitExecutablePath: {0}" , gitSetup . GitExecutablePath ) ;
34
- gitSetup . GitExecutablePath . FileExists ( ) . Should ( ) . BeTrue ( ) ;
34
+ Logger . Trace ( "Expected GitExecutablePath: {0}" , gitSetup . GitExecutablePath ) ;
35
+ gitSetup . GitExecutablePath . FileExists ( ) . Should ( ) . BeTrue ( ) ;
35
36
36
- var gitLfsDestinationPath = gitSetup . GitInstallationPath ;
37
+ var gitLfsDestinationPath = gitSetup . GitInstallationPath ;
37
38
gitLfsDestinationPath = gitLfsDestinationPath . Combine ( "mingw32" ) ;
38
39
39
- gitLfsDestinationPath = gitLfsDestinationPath . Combine ( "libexec" , "git-core" , "git-lfs.exe" ) ;
40
- gitLfsDestinationPath . FileExists ( ) . Should ( ) . BeTrue ( ) ;
40
+ gitLfsDestinationPath = gitLfsDestinationPath . Combine ( "libexec" , "git-core" , "git-lfs.exe" ) ;
41
+ gitLfsDestinationPath . FileExists ( ) . Should ( ) . BeTrue ( ) ;
41
42
42
- var calculateMd5 = NPathFileSystemProvider . Current . CalculateMD5 ( gitLfsDestinationPath ) ;
43
- GitInstaller . GitLfsExecutableMD5 . Should ( ) . Be ( calculateMd5 ) ;
43
+ var calculateMd5 = NPathFileSystemProvider . Current . CalculateMD5 ( gitLfsDestinationPath ) ;
44
+ GitInstaller . GitLfsExecutableMD5 . Should ( ) . Be ( calculateMd5 ) ;
44
45
45
- setupDone = gitSetup . SetupIfNeeded ( percentage : new Progress < float > ( x => percent = x ) ) . Result ;
46
- setupDone . Should ( ) . BeFalse ( ) ;
46
+ setupDone = gitSetup . SetupIfNeeded ( percentage : new Progress < float > ( x => percent = x ) ) . Result ;
47
+ setupDone . Should ( ) . BeFalse ( ) ;
47
48
}
48
49
else
49
50
{
50
51
environment . GitExecutablePath = "/usr/local/bin/git" ;
51
- setupDone . Should ( ) . BeFalse ( ) ;
52
+ setupDone . Should ( ) . BeFalse ( ) ;
52
53
}
53
54
54
55
var platform = new Platform ( environment , FileSystem , new TestUIDispatcher ( ) ) ;
@@ -61,5 +62,25 @@ public void InstallGit()
61
62
new GitBranch ( "master" , "origin/master: behind 1" , true ) ,
62
63
new GitBranch ( "feature/document" , "origin/feature/document" , false ) ) ;
63
64
}
65
+
66
+
67
+ [ Test ]
68
+ public void VerifyGitLfsBundle ( )
69
+ {
70
+ var environmentPath = NPath . CreateTempDirectory ( "integration-test-environment" ) ;
71
+
72
+ var gitLfsPath = environmentPath . Combine ( "git-lfs.exe" ) ;
73
+ gitLfsPath . Exists ( ) . Should ( ) . BeFalse ( ) ;
74
+
75
+ var inputZipFile = SolutionDirectory . ToNPath ( ) . Combine ( "PlatformResources" , "windows" , "git-lfs.zip" ) ;
76
+
77
+ var fastZip = new FastZip ( ) ;
78
+ fastZip . ExtractZip ( inputZipFile , environmentPath , null ) ;
79
+
80
+ gitLfsPath . Exists ( ) . Should ( ) . BeTrue ( ) ;
81
+
82
+ var calculateMd5 = NPathFileSystemProvider . Current . CalculateMD5 ( gitLfsPath ) ;
83
+ GitInstaller . GitLfsExecutableMD5 . Should ( ) . Be ( calculateMd5 ) ;
84
+ }
64
85
}
65
86
}
0 commit comments