File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
test/Azure.Functions.Sdk.Tests/Integration Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,43 @@ public void Restore_InvalidFunctionsVersion_Fail()
7171 File . Exists ( GeneratedHashPath ) . Should ( ) . BeFalse ( ) ;
7272 }
7373
74+ [ Fact ]
75+ public void Restore_Incremental_NoOp ( )
76+ {
77+ // Arrange
78+ ProjectCreator project = ProjectCreator . Templates . AzureFunctionsProject (
79+ GetTempCsproj ( ) )
80+ . ItemPackageReference ( NugetPackage . ServiceBus )
81+ . ItemPackageReference ( NugetPackage . Storage ) ;
82+
83+ // Act 1
84+ BuildOutput output = project . Restore ( ) ;
85+
86+ // Assert 2
87+ output . Should ( ) . BeSuccessful ( ) . And . HaveNoIssues ( ) ;
88+ ValidateProject (
89+ [
90+ .. NugetPackage . ServiceBus . WebJobsPackages ,
91+ .. NugetPackage . StorageBlobs . WebJobsPackages ,
92+ .. NugetPackage . StorageQueues . WebJobsPackages ,
93+ ] ) ;
94+
95+ FileInfo generated = new ( GeneratedProjectPath ) ;
96+ FileInfo hash = new ( GeneratedHashPath ) ;
97+
98+ DateTime generatedWrite = generated . LastWriteTimeUtc ;
99+ DateTime hashWrite = hash . LastWriteTimeUtc ;
100+
101+ // Act 2
102+ BuildOutput output2 = project . Restore ( ) ;
103+ output2 . Should ( ) . BeSuccessful ( ) . And . HaveNoIssues ( ) ;
104+ generated . Refresh ( ) ;
105+ hash . Refresh ( ) ;
106+
107+ generated . LastWriteTimeUtc . Should ( ) . Be ( generatedWrite ) ;
108+ hash . LastWriteTimeUtc . Should ( ) . Be ( hashWrite ) ;
109+ }
110+
74111 private void ValidateProject ( params NugetPackage [ ] packages )
75112 {
76113 FileInfo hashFile = new ( GeneratedHashPath ) ;
You can’t perform that action at this time.
0 commit comments