File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
test/dotnet.Tests/ParserTests Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4+ using System . CommandLine . Parsing ;
45using Microsoft . DotNet . Cli ;
56using Microsoft . DotNet . Cli . Utils ;
67using Parser = Microsoft . DotNet . Cli . Parser ;
@@ -50,13 +51,11 @@ public void AddReferenceWithoutArgumentResultsInAnError()
5051 {
5152 var result = Parser . Instance . Parse ( "dotnet add reference" ) ;
5253
53- result
54- . Errors
55- . Select ( e => e . Message )
56- . Should ( )
57- // This string comes from System.CommandLine:
58- // https://github.com/dotnet/command-line-api/blob/b4485d8417c4eb0ec3d1a291e1003686618ce598/src/System.CommandLine/Properties/Resources.resx#L135-L137
59- . BeEquivalentTo ( "Required argument missing for command: 'reference'." ) ;
54+ result . Errors . Should ( ) . NotBeEmpty ( ) ;
55+
56+ var argument = ( result . Errors . FirstOrDefault ( ) ? . SymbolResult as ArgumentResult ) ? . Argument ;
57+
58+ argument . Should ( ) . Be ( ReferenceAddCommandParser . ProjectPathArgument ) ;
6059 }
6160 }
6261}
You can’t perform that action at this time.
0 commit comments