@@ -131,6 +131,154 @@ 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 --float 3.14 --hex 0x1A2F --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 ( "float" , paramType : "float" )
198+ . WithParameter ( "hex" , paramType : "hex" )
199+ . WithParameter ( "bool" , paramType : "bool" )
200+ . WithParameter ( "string" , paramType : "string" )
201+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
202+ } ,
203+ new string ? [ ] [ ]
204+ {
205+ new string ? [ ] { "name" , null , "--fake" , null , null }
206+ }
207+ } ;
208+
209+ yield return new object [ ]
210+ {
211+ "foo --int 6 --float 3.14 --hex 0x1A2F --bool --string stringtype --choice c1 --fake value" ,
212+ new MockTemplateInfo [ ]
213+ {
214+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" )
215+ . WithParameter ( "int" , paramType : "integer" )
216+ . WithParameter ( "float" , paramType : "float" )
217+ . WithParameter ( "hex" , paramType : "hex" )
218+ . WithParameter ( "bool" , paramType : "bool" )
219+ . WithParameter ( "string" , paramType : "string" )
220+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
221+ } ,
222+ new string ? [ ] [ ]
223+ {
224+ new string ? [ ] { "name" , null , "--fake" , null , null } ,
225+ new string ? [ ] { "name" , null , "value" , null , null }
226+ }
227+ } ;
228+
229+ yield return new object [ ]
230+ {
231+ "foo --language F# --int 6 --float 3.14 --hex 0x1A2F --bool --string stringtype --choice c1 --include" ,
232+ new MockTemplateInfo [ ]
233+ {
234+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithTag ( "language" , "C#" )
235+ . WithParameter ( "int" , paramType : "integer" )
236+ . WithParameter ( "float" , paramType : "float" )
237+ . WithParameter ( "hex" , paramType : "hex" )
238+ . WithParameter ( "bool" , paramType : "bool" )
239+ . WithParameter ( "string" , paramType : "string" )
240+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
241+ . WithParameter ( "include" , "bool" ) ,
242+ new MockTemplateInfo ( "foo" , identity : "foo.2" , groupIdentity : "foo.group" ) . WithTag ( "language" , "F#" )
243+ . WithParameter ( "int" , paramType : "integer" )
244+ . WithParameter ( "float" , paramType : "float" )
245+ . WithParameter ( "hex" , paramType : "hex" )
246+ . WithParameter ( "bool" , paramType : "bool" )
247+ . WithParameter ( "string" , paramType : "string" )
248+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
249+ } ,
250+ new string ? [ ] [ ]
251+ {
252+ new string ? [ ] { "name" , null , "--include" , null , null }
253+ }
254+ } ;
255+
256+ yield return new object [ ]
257+ {
258+ "foo --language F# --int 6 --float 3.14 --hex 0x1A2F --bool --string stringtype --choice c1 --exclude" ,
259+ new MockTemplateInfo [ ]
260+ {
261+ new MockTemplateInfo ( "foo" , identity : "foo.1" , groupIdentity : "foo.group" ) . WithTag ( "language" , "C#" )
262+ . WithParameter ( "int" , paramType : "integer" )
263+ . WithParameter ( "float" , paramType : "float" )
264+ . WithParameter ( "hex" , paramType : "hex" )
265+ . WithParameter ( "bool" , paramType : "bool" )
266+ . WithParameter ( "string" , paramType : "string" )
267+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
268+ . WithParameter ( "include" , "bool" ) ,
269+ new MockTemplateInfo ( "foo" , identity : "foo.2" , groupIdentity : "foo.group" ) . WithTag ( "language" , "F#" )
270+ . WithParameter ( "int" , paramType : "integer" )
271+ . WithParameter ( "float" , paramType : "float" )
272+ . WithParameter ( "hex" , paramType : "hex" )
273+ . WithParameter ( "bool" , paramType : "bool" )
274+ . WithParameter ( "string" , paramType : "string" )
275+ . WithChoiceParameter ( "choice" , "c1" , "c2" )
276+ } ,
277+ new string ? [ ] [ ]
278+ {
279+ new string ? [ ] { "name" , null , "--exclude" , null , null }
280+ }
281+ } ;
134282 }
135283
136284 [ Theory ]
0 commit comments