11using System ;
22using Cake . Core ;
33using System . Collections . Generic ;
4+ using System . Linq ;
45
56namespace Cake . AppVeyor . Fakes
67{
78 internal sealed class FakeCakeArguments : ICakeArguments
89 {
9- private readonly Dictionary < string , string > _arguments ;
10+ private readonly Dictionary < string , List < string > > _arguments ;
1011
1112 /// <summary>
1213 /// Gets the arguments.
1314 /// </summary>
1415 /// <value>The arguments.</value>
15- public IReadOnlyDictionary < string , string > Arguments
16+ public IReadOnlyDictionary < string , List < string > > Arguments
1617 {
1718 get { return _arguments ; }
1819 }
@@ -22,14 +23,14 @@ public IReadOnlyDictionary<string, string> Arguments
2223 /// </summary>
2324 public FakeCakeArguments ( )
2425 {
25- _arguments = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
26+ _arguments = new Dictionary < string , List < string > > ( StringComparer . OrdinalIgnoreCase ) ;
2627 }
2728
2829 /// <summary>
2930 /// Initializes the argument list.
3031 /// </summary>
3132 /// <param name="arguments">The arguments.</param>
32- public void SetArguments ( IDictionary < string , string > arguments )
33+ public void SetArguments ( IDictionary < string , List < string > > arguments )
3334 {
3435 if ( arguments == null )
3536 {
@@ -61,8 +62,13 @@ public bool HasArgument(string name)
6162 /// <returns>The argument value.</returns>
6263 public string GetArgument ( string name )
6364 {
64- return _arguments . ContainsKey ( name )
65- ? _arguments [ name ] : null ;
65+ return GetArguments ( name ) . LastOrDefault ( ) ;
66+ }
67+
68+ public ICollection < string > GetArguments ( string name )
69+ {
70+ _arguments . TryGetValue ( name , out var arguments ) ;
71+ return arguments ?? ( ICollection < string > ) Array . Empty < string > ( ) ;
6672 }
6773 }
6874}
0 commit comments