public void DynamicParametersPositionIsResolvedAfterNormalParameterPosition()
 {
     // although the normal parameter "DefaultMessage" has position 5, and the dynamic parameter has position 0,
     // normal parameters by position are resolved and bound first
     var parameters = new TestDynamicParameters("bar", null);
     ExecuteAndCompareTypedResult(_cmdletName + " foo bar -UseParameters", true, "foo", parameters);
 }
Beispiel #2
0
 public object GetDynamicParameters()
 {
     if (UseParameters.IsPresent)
     {
         _params = new TestDynamicParameters();
         return(_params);
     }
     return(null);
 }
 public void DynamicParametersCanTakeOptionalParameters()
 {
     var parameters = new TestDynamicParameters("foo", "bar");
     ExecuteAndCompareTypedResult(_cmdletName + " -MessageOne foo -UseParameters -MessageTwo 'bar' ", true, null, parameters);
 }
 public void DynamicParametersCanUsePositionalOnlyAfterNormalParameters()
 {
     var parameters = new TestDynamicParameters("foo", null);
     ExecuteAndCompareTypedResult(_cmdletName + " -DefaultMessage bar -UseParameters foo", true, "bar", parameters);
 }
 public void DynamicParametersCanTakeOnlyMandatory()
 {
     var parameters = new TestDynamicParameters("foo", null);
     ExecuteAndCompareTypedResult(_cmdletName + " -MessageOne foo -UseParameters", true, null, parameters);
 }
Beispiel #6
0
 public object GetDynamicParameters()
 {
     if (UseParameters.IsPresent)
     {
         _params = new TestDynamicParameters();
         return _params;
     }
     return null;
 }