File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
test/dotnet.Tests/CommandTests/Restore Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
using Microsoft . DotNet . Tools . Test . Utilities ;
5
+ using Newtonsoft . Json . Linq ;
5
6
using System . Runtime . InteropServices ;
6
7
7
8
namespace Microsoft . DotNet . Restore . Test
@@ -205,6 +206,22 @@ public void ItRestoresWithRidSpecificOptions(params string[] ridOptions)
205
206
// Verify that assets file was created
206
207
var assetsFilePath = Path . Combine ( rootPath , "obj" , "project.assets.json" ) ;
207
208
File . Exists ( assetsFilePath ) . Should ( ) . BeTrue ( ) ;
209
+
210
+ // Verify that the assets file contains RID-specific targets when using RID options
211
+ if ( ridOptions . Contains ( "-r" ) || ridOptions . Contains ( "--runtime" ) ||
212
+ ridOptions . Contains ( "--os" ) || ridOptions . Contains ( "-a" ) || ridOptions . Contains ( "--arch" ) )
213
+ {
214
+ var assetsContents = JObject . Parse ( File . ReadAllText ( assetsFilePath ) ) ;
215
+ var targets = assetsContents [ "targets" ] ;
216
+ targets . Should ( ) . NotBeNull ( "assets file should contain targets section" ) ;
217
+
218
+ // Check for RID-specific targets (targets with RID have names containing "/")
219
+ var ridSpecificTargets = targets . Children < JProperty > ( )
220
+ . Where ( target => target . Name . Contains ( "/" ) )
221
+ . ToList ( ) ;
222
+
223
+ ridSpecificTargets . Should ( ) . NotBeEmpty ( "assets file should contain RID-specific targets when using RID options" ) ;
224
+ }
208
225
}
209
226
210
227
private static string [ ] HandleStaticGraphEvaluation ( bool useStaticGraphEvaluation , string [ ] args ) =>
You can’t perform that action at this time.
0 commit comments