@@ -131,6 +131,142 @@ public static IEnumerable<object[]> GetInvalidParametersTestData()
131131 new string ? [ ] { "value" , "langVersion" , "--langVersion" , null , "Required argument missing for option: '--langVersion'." }
132132 }
133133 } ;
134+
135+ yield return new object [ ]
136+ {
137+ "foo --fake" ,
138+ new MockTemplateInfo [ ]
139+ {
140+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithParameter ( "langVersion" )
141+ } ,
142+ new string ? [ ] [ ]
143+ {
144+ new string ? [ ] { "name" , null , "--fake" , null , null }
145+ }
146+ } ;
147+
148+ yield return new object [ ]
149+ {
150+ "foo --fake value" ,
151+ new MockTemplateInfo [ ]
152+ {
153+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithParameter ( "langVersion" )
154+ } ,
155+ new string ? [ ] [ ]
156+ {
157+ new string ? [ ] { "name" , null , "--fake" , null , null } ,
158+ new string ? [ ] { "name" , null , "value" , null , null }
159+ }
160+ } ;
161+
162+ yield return new object [ ]
163+ {
164+ "foo --language F# --include" ,
165+ new MockTemplateInfo [ ]
166+ {
167+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithTag ( "language" , "C#" ) . WithParameter ( "include" , "bool" ) ,
168+ new MockTemplateInfo ( "foo" , identity : "foo.2" , groupIdentity : "foo.group" ) . WithTag ( "language" , "F#" )
169+ } ,
170+ new string ? [ ] [ ]
171+ {
172+ new string ? [ ] { "name" , null , "--include" , null , null }
173+ }
174+ } ;
175+
176+ yield return new object [ ]
177+ {
178+ "foo --language F# --exclude" ,
179+ new MockTemplateInfo [ ]
180+ {
181+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithTag ( "language" , "C#" ) . WithParameter ( "include" , "bool" ) ,
182+ new MockTemplateInfo ( "foo" , identity : "foo.2" , groupIdentity : "foo.group" ) . WithTag ( "language" , "F#" )
183+ } ,
184+ new string ? [ ] [ ]
185+ {
186+ new string ? [ ] { "name" , null , "--exclude" , null , null }
187+ }
188+ } ;
189+
190+ yield return new object [ ]
191+ {
192+ "foo --int 6 --bool --string stringtype --choice c1 --fake" ,
193+ new MockTemplateInfo [ ]
194+ {
195+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" )
196+ . WithParameter ( "int" , paramType : "integer" )
197+ . WithParameter ( "bool" , paramType : "bool" )
198+ . WithParameter ( "string" , paramType : "string" )
199+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
200+ } ,
201+ new string ? [ ] [ ]
202+ {
203+ new string ? [ ] { "name" , null , "--fake" , null , null }
204+ }
205+ } ;
206+
207+ yield return new object [ ]
208+ {
209+ "foo --int 6 --bool --string stringtype --choice c1 --fake value" ,
210+ new MockTemplateInfo [ ]
211+ {
212+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" )
213+ . WithParameter ( "int" , paramType : "integer" )
214+ . WithParameter ( "bool" , paramType : "bool" )
215+ . WithParameter ( "string" , paramType : "string" )
216+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
217+ } ,
218+ new string ? [ ] [ ]
219+ {
220+ new string ? [ ] { "name" , null , "--fake" , null , null } ,
221+ new string ? [ ] { "name" , null , "value" , null , null }
222+ }
223+ } ;
224+
225+ yield return new object [ ]
226+ {
227+ "foo --language F# --int 6 --bool --string stringtype --choice c1 --include" ,
228+ new MockTemplateInfo [ ]
229+ {
230+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithTag ( "language" , "C#" )
231+ . WithParameter ( "int" , paramType : "integer" )
232+ . WithParameter ( "bool" , paramType : "bool" )
233+ . WithParameter ( "string" , paramType : "string" )
234+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
235+ . WithParameter ( "include" , "bool" ) ,
236+ new MockTemplateInfo ( "foo" , identity : "foo.2" , groupIdentity : "foo.group" ) . WithTag ( "language" , "F#" )
237+ . WithParameter ( "int" , paramType : "integer" )
238+ . WithParameter ( "bool" , paramType : "bool" )
239+ . WithParameter ( "string" , paramType : "string" )
240+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
241+ } ,
242+ new string ? [ ] [ ]
243+ {
244+ new string ? [ ] { "name" , null , "--include" , null , null }
245+ }
246+ } ;
247+
248+ yield return new object [ ]
249+ {
250+ "foo --language F# --int 6 --bool --string stringtype --choice c1 --exclude" ,
251+ new MockTemplateInfo [ ]
252+ {
253+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithTag ( "language" , "C#" )
254+ . WithParameter ( "int" , paramType : "integer" )
255+ . WithParameter ( "bool" , paramType : "bool" )
256+ . WithParameter ( "string" , paramType : "string" )
257+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
258+ . WithParameter ( "include" , "bool" ) ,
259+ new MockTemplateInfo ( "foo" , identity : "foo.2" , groupIdentity : "foo.group" ) . WithTag ( "language" , "F#" )
260+ . WithParameter ( "int" , paramType : "integer" )
261+ . WithParameter ( "bool" , paramType : "bool" )
262+ . WithParameter ( "string" , paramType : "string" )
263+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
264+ } ,
265+ new string ? [ ] [ ]
266+ {
267+ new string ? [ ] { "name" , null , "--exclude" , null , null }
268+ }
269+ } ;
134270 }
135271
136272 [ Theory ]
0 commit comments