@@ -19,6 +19,7 @@ public GivenDotnetPublishInvocation(ITestOutputHelper output)
19
19
20
20
private static readonly string [ ] ExpectedPrefix = [ "-maxcpucount" , "-verbosity:m" , "-tlp:default=auto" , "-nologo" ] ;
21
21
private static readonly string [ ] ExpectedProperties = [ "--property:_IsPublishing=true" ] ;
22
+ private static readonly string NuGetDisabledProperty = "-property:NuGetInteractive=false" ;
22
23
23
24
[ Theory ]
24
25
[ InlineData ( new string [ ] { } , new string [ ] { } ) ]
@@ -56,7 +57,7 @@ public void MsbuildInvocationIsCorrect(string[] args, string[] expectedAdditiona
56
57
57
58
command . GetArgumentTokensToMSBuild ( )
58
59
. Should ( )
59
- . BeEquivalentTo ( [ .. ExpectedPrefix , "-restore" , "-target:Publish" , .. ExpectedProperties , .. expectedAdditionalArgs ] ) ;
60
+ . BeEquivalentTo ( [ .. ExpectedPrefix , "-restore" , "-target:Publish" , .. ExpectedProperties , .. expectedAdditionalArgs , NuGetDisabledProperty ] ) ;
60
61
} ) ;
61
62
}
62
63
@@ -68,14 +69,23 @@ public void MsbuildInvocationIsCorrectForSeparateRestore(string[] args, string[]
68
69
var msbuildPath = "<msbuildpath>" ;
69
70
var command = PublishCommand . FromArgs ( args , msbuildPath ) ;
70
71
71
- command . SeparateRestoreCommand
72
- . GetArgumentTokensToMSBuild ( )
72
+ var restoreTokens =
73
+ command . SeparateRestoreCommand
74
+ . GetArgumentTokensToMSBuild ( ) ;
75
+ output . WriteLine ( "restore tokens:" ) ;
76
+ output . WriteLine ( string . Join ( " " , restoreTokens ) ) ;
77
+ restoreTokens
73
78
. Should ( )
74
- . BeEquivalentTo ( [ .. ExpectedPrefix , "-target:Restore" , "-tlp:verbosity=quiet" , .. ExpectedProperties ] ) ;
79
+ . BeEquivalentTo ( [ .. ExpectedPrefix , "-target:Restore" , "-tlp:verbosity=quiet" , .. ExpectedProperties , NuGetDisabledProperty ] ) ;
75
80
76
- command . GetArgumentTokensToMSBuild ( )
81
+ var buildTokens =
82
+ command . GetArgumentTokensToMSBuild ( ) ;
83
+ output . WriteLine ( "build tokens:" ) ;
84
+ output . WriteLine ( string . Join ( " " , buildTokens ) ) ;
85
+
86
+ buildTokens
77
87
. Should ( )
78
- . BeEquivalentTo ( [ .. ExpectedPrefix , "-nologo" , "-target:Publish" , .. ExpectedProperties , .. expectedAdditionalArgs ] ) ;
88
+ . BeEquivalentTo ( [ .. ExpectedPrefix , "-nologo" , "-target:Publish" , .. ExpectedProperties , .. expectedAdditionalArgs , NuGetDisabledProperty ] ) ;
79
89
}
80
90
81
91
[ Fact ]
@@ -90,7 +100,7 @@ public void MsbuildInvocationIsCorrectForNoBuild()
90
100
91
101
command . GetArgumentTokensToMSBuild ( )
92
102
. Should ( )
93
- . BeEquivalentTo ( [ .. ExpectedPrefix , "-target:Publish" , .. ExpectedProperties , "-property:NoBuild=true" ] ) ;
103
+ . BeEquivalentTo ( [ .. ExpectedPrefix , "-target:Publish" , .. ExpectedProperties , "-property:NoBuild=true" , NuGetDisabledProperty ] ) ;
94
104
}
95
105
96
106
[ Fact ]
@@ -101,7 +111,7 @@ public void CommandAcceptsMultipleCustomProperties()
101
111
102
112
command . GetArgumentTokensToMSBuild ( )
103
113
. Should ( )
104
- . BeEquivalentTo ( [ .. ExpectedPrefix , "-restore" , "-target:Publish" , .. ExpectedProperties , "--property:Prop1=prop1" , "--property:Prop2=prop2" ] ) ;
114
+ . BeEquivalentTo ( [ .. ExpectedPrefix , "-restore" , "-target:Publish" , .. ExpectedProperties , "--property:Prop1=prop1" , "--property:Prop2=prop2" , NuGetDisabledProperty ] ) ;
105
115
}
106
116
}
107
117
}
0 commit comments