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 1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
+ using System . CommandLine . Parsing ;
4
5
using Microsoft . DotNet . Cli ;
5
6
using Microsoft . DotNet . Cli . Utils ;
6
7
using Parser = Microsoft . DotNet . Cli . Parser ;
@@ -50,13 +51,11 @@ public void AddReferenceWithoutArgumentResultsInAnError()
50
51
{
51
52
var result = Parser . Instance . Parse ( "dotnet add reference" ) ;
52
53
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 ) ;
60
59
}
61
60
}
62
61
}
You can’t perform that action at this time.
0 commit comments