@@ -6,40 +6,14 @@ namespace Cake.ExtendedNuGet.Tests.Fakes
6
6
{
7
7
internal sealed class FakeCakeArguments : ICakeArguments
8
8
{
9
- private readonly Dictionary < string , string > _arguments ;
10
-
11
- /// <summary>
12
- /// Gets the arguments.
13
- /// </summary>
14
- /// <value>The arguments.</value>
15
- public IReadOnlyDictionary < string , string > Arguments
16
- {
17
- get { return _arguments ; }
18
- }
9
+ private readonly Dictionary < string , ICollection < string > > _arguments ;
19
10
20
11
/// <summary>
21
12
/// Initializes a new instance of the <see cref="CakeArguments"/> class.
22
13
/// </summary>
23
14
public FakeCakeArguments ( )
24
15
{
25
- _arguments = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
26
- }
27
-
28
- /// <summary>
29
- /// Initializes the argument list.
30
- /// </summary>
31
- /// <param name="arguments">The arguments.</param>
32
- public void SetArguments ( IDictionary < string , string > arguments )
33
- {
34
- if ( arguments == null )
35
- {
36
- throw new ArgumentNullException ( "arguments" ) ;
37
- }
38
- _arguments . Clear ( ) ;
39
- foreach ( var argument in arguments )
40
- {
41
- _arguments . Add ( argument . Key , argument . Value ) ;
42
- }
16
+ _arguments = new Dictionary < string , ICollection < string > > ( StringComparer . OrdinalIgnoreCase ) ;
43
17
}
44
18
45
19
/// <summary>
@@ -54,15 +28,9 @@ public bool HasArgument(string name)
54
28
return _arguments . ContainsKey ( name ) ;
55
29
}
56
30
57
- /// <summary>
58
- /// Gets an argument.
59
- /// </summary>
60
- /// <param name="name">The argument name.</param>
61
- /// <returns>The argument value.</returns>
62
- public string GetArgument ( string name )
31
+ public ICollection < string > GetArguments ( string name )
63
32
{
64
- return _arguments . ContainsKey ( name )
65
- ? _arguments [ name ] : null ;
33
+ return _arguments . TryGetValue ( name , out var val ) ? val : new List < string > ( ) ;
66
34
}
67
35
}
68
36
}
0 commit comments