Skip to content

Commit

Permalink
Tests update
Browse files Browse the repository at this point in the history
Added additional parameter before params array, to make sure that is being handled properly.
  • Loading branch information
dlwyatt committed Oct 25, 2014
1 parent 6834abf commit 49b375d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GenericMethods.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Describe 'GenericMethods' {
return message;
}
public static string ParamsArgumentTest<T>(params string[] values)
public static string ParamsArgumentTest<T>(int required, params string[] values)
{
return string.Format("T: {0} , values: {1}", typeof(T).FullName, string.Join(" ", values));
return string.Format("T: {0}, required: {1}, values: {2}", typeof(T).FullName, required, string.Join(" ", values));
}
}
'@
Expand Down Expand Up @@ -243,11 +243,11 @@ Describe 'GenericMethods' {
}

Context 'Method with params argument' {
$strings = 'One', 'Two', 'Three', 'Four', 'Five'
$arguments = 10, 'One', 'Two', 'Three', 'Four', 'Five'

It 'Invokes the method with a params argument' {
$result = Invoke-GenericMethod -Type TestClass -MethodName ParamsArgumentTest -GenericType object -ArgumentList $strings -ErrorAction Stop
$result | Should Be 'T: System.Object , values: One Two Three Four Five'
$result = Invoke-GenericMethod -Type TestClass -MethodName ParamsArgumentTest -GenericType object -ArgumentList $arguments -ErrorAction Stop
$result | Should Be 'T: System.Object, required: 10, values: One Two Three Four Five'
}
}
}

0 comments on commit 49b375d

Please sign in to comment.