@@ -17,61 +17,214 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
1717 {
1818 #region while
1919
20- yield return new TestCaseData ( Resources . Script0001 , null , true ) . SetCategory ( "Script" ) . SetCategory ( "while" ) . SetCategory ( "variable assignation" ) . SetCategory ( "++" ) . SetCategory ( "+=" ) . Returns ( "0,1,2,3,4" ) ;
21- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0001 , "" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "while" ) . SetCategory ( "variable assignation" ) . SetCategory ( "++" ) . SetCategory ( "+=" ) . Returns ( "0,1,2,3,4" ) ;
20+ yield return new TestCaseData ( Resources . Script0001 , null , true )
21+ . SetCategory ( "Script" )
22+ . SetCategory ( "while" )
23+ . SetCategory ( "variable assignation" )
24+ . SetCategory ( "++" )
25+ . SetCategory ( "+=" )
26+ . Returns ( "0,1,2,3,4" ) ;
27+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0001 , "" ) , null , true )
28+ . SetCategory ( "Script" )
29+ . SetCategory ( "while" )
30+ . SetCategory ( "variable assignation" )
31+ . SetCategory ( "++" )
32+ . SetCategory ( "+=" )
33+ . Returns ( "0,1,2,3,4" ) ;
2234
2335 #endregion
2436
2537 #region for
2638
27- yield return new TestCaseData ( Resources . Script0002 , null , true ) . SetCategory ( "Script" ) . SetCategory ( "for" ) . SetCategory ( "variable assignation" ) . SetCategory ( "++" ) . SetCategory ( "+=" ) . Returns ( "0,1,2,3,4" ) ;
28- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0002 , "" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "for" ) . SetCategory ( "variable assignation" ) . SetCategory ( "++" ) . SetCategory ( "+=" ) . Returns ( "0,1,2,3,4" ) ;
29- yield return new TestCaseData ( Resources . Script0003 , null , true ) . SetCategory ( "Script" ) . SetCategory ( "for" ) . SetCategory ( "variable assignation" ) . SetCategory ( "++" ) . SetCategory ( "+=" ) . Returns ( "0,1,2,3,4" ) ;
30- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0003 , "" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "for" ) . SetCategory ( "variable assignation" ) . SetCategory ( "++" ) . SetCategory ( "+=" ) . Returns ( "0,1,2,3,4" ) ;
39+ yield return new TestCaseData ( Resources . Script0002 , null , true )
40+ . SetCategory ( "Script" )
41+ . SetCategory ( "for" )
42+ . SetCategory ( "variable assignation" )
43+ . SetCategory ( "++" )
44+ . SetCategory ( "+=" )
45+ . Returns ( "0,1,2,3,4" ) ;
46+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0002 , "" ) , null , true )
47+ . SetCategory ( "Script" )
48+ . SetCategory ( "for" )
49+ . SetCategory ( "variable assignation" )
50+ . SetCategory ( "++" )
51+ . SetCategory ( "+=" )
52+ . Returns ( "0,1,2,3,4" ) ;
53+ yield return new TestCaseData ( Resources . Script0003 , null , true )
54+ . SetCategory ( "Script" )
55+ . SetCategory ( "for" )
56+ . SetCategory ( "variable assignation" )
57+ . SetCategory ( "++" )
58+ . SetCategory ( "+=" )
59+ . Returns ( "0,1,2,3,4" ) ;
60+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0003 , "" ) , null , true )
61+ . SetCategory ( "Script" )
62+ . SetCategory ( "for" )
63+ . SetCategory ( "variable assignation" )
64+ . SetCategory ( "++" )
65+ . SetCategory ( "+=" )
66+ . Returns ( "0,1,2,3,4" ) ;
3167
3268 #endregion
3369
3470 #region if, else if, else
3571
36- yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
37- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
38- yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
39- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
40- yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
41- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
72+ yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , null , true )
73+ . SetCategory ( "Script" )
74+ . SetCategory ( "if" )
75+ . SetCategory ( "variable assignation" )
76+ . Returns ( 1 ) ;
77+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true )
78+ . SetCategory ( "Script" )
79+ . SetCategory ( "if" )
80+ . SetCategory ( "variable assignation" )
81+ . Returns ( 1 ) ;
82+ yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , null , true )
83+ . SetCategory ( "Script" )
84+ . SetCategory ( "if" )
85+ . SetCategory ( "variable assignation" )
86+ . Returns ( 1 ) ;
87+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true )
88+ . SetCategory ( "Script" )
89+ . SetCategory ( "if" )
90+ . SetCategory ( "variable assignation" )
91+ . Returns ( 1 ) ;
92+ yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , null , true )
93+ . SetCategory ( "Script" )
94+ . SetCategory ( "if" )
95+ . SetCategory ( "variable assignation" )
96+ . Returns ( 1 ) ;
97+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true )
98+ . SetCategory ( "Script" )
99+ . SetCategory ( "if" )
100+ . SetCategory ( "variable assignation" )
101+ . Returns ( 1 ) ;
42102
43- yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 2 ) ;
44- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 2 ) ;
103+ yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , null , true )
104+ . SetCategory ( "Script" )
105+ . SetCategory ( "if" )
106+ . SetCategory ( "variable assignation" )
107+ . Returns ( 2 ) ;
108+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true )
109+ . SetCategory ( "Script" )
110+ . SetCategory ( "if" )
111+ . SetCategory ( "variable assignation" )
112+ . Returns ( 2 ) ;
45113
46- yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 3 ) ;
47- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 3 ) ;
114+ yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , null , true )
115+ . SetCategory ( "Script" )
116+ . SetCategory ( "if" )
117+ . SetCategory ( "variable assignation" )
118+ . Returns ( 3 ) ;
119+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true )
120+ . SetCategory ( "Script" )
121+ . SetCategory ( "if" )
122+ . SetCategory ( "variable assignation" )
123+ . Returns ( 3 ) ;
48124
49- yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 4 ) ;
50- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 4 ) ;
125+ yield return new TestCaseData ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , null , true )
126+ . SetCategory ( "Script" )
127+ . SetCategory ( "if" )
128+ . SetCategory ( "variable assignation" )
129+ . Returns ( 4 ) ;
130+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0004 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true )
131+ . SetCategory ( "Script" )
132+ . SetCategory ( "if" )
133+ . SetCategory ( "variable assignation" )
134+ . Returns ( 4 ) ;
51135
52- yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
53- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
54- yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
55- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
56- yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
57- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 1 ) ;
136+ yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , null , true )
137+ . SetCategory ( "Script" )
138+ . SetCategory ( "if" )
139+ . SetCategory ( "variable assignation" )
140+ . Returns ( 1 ) ;
141+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true )
142+ . SetCategory ( "Script" )
143+ . SetCategory ( "if" )
144+ . SetCategory ( "variable assignation" )
145+ . Returns ( 1 ) ;
146+ yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , null , true )
147+ . SetCategory ( "Script" )
148+ . SetCategory ( "if" )
149+ . SetCategory ( "variable assignation" )
150+ . Returns ( 1 ) ;
151+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true )
152+ . SetCategory ( "Script" )
153+ . SetCategory ( "if" )
154+ . SetCategory ( "variable assignation" )
155+ . Returns ( 1 ) ;
156+ yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , null , true )
157+ . SetCategory ( "Script" )
158+ . SetCategory ( "if" )
159+ . SetCategory ( "variable assignation" )
160+ . Returns ( 1 ) ;
161+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "1" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" )
162+ . SetCategory ( "if" )
163+ . SetCategory ( "variable assignation" )
164+ . Returns ( 1 ) ;
58165
59- yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 2 ) ;
60- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 2 ) ;
166+ yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , null , true )
167+ . SetCategory ( "Script" )
168+ . SetCategory ( "if" )
169+ . SetCategory ( "variable assignation" )
170+ . Returns ( 2 ) ;
171+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "0" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true )
172+ . SetCategory ( "Script" )
173+ . SetCategory ( "if" )
174+ . SetCategory ( "variable assignation" )
175+ . Returns ( 2 ) ;
61176
62- yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 3 ) ;
63- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 3 ) ;
177+ yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , null , true )
178+ . SetCategory ( "Script" )
179+ . SetCategory ( "if" )
180+ . SetCategory ( "variable assignation" )
181+ . Returns ( 3 ) ;
182+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "-1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true )
183+ . SetCategory ( "Script" )
184+ . SetCategory ( "if" )
185+ . SetCategory ( "variable assignation" )
186+ . Returns ( 3 ) ;
64187
65- yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 4 ) ;
66- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "if" ) . SetCategory ( "variable assignation" ) . Returns ( 4 ) ;
188+ yield return new TestCaseData ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , null , true )
189+ . SetCategory ( "Script" )
190+ . SetCategory ( "if" )
191+ . SetCategory ( "variable assignation" )
192+ . Returns ( 4 ) ;
193+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0005 . Replace ( "[valx]" , "1" ) . Replace ( "[valy]" , "0" ) , "" ) . Replace ( "else" , "else " ) , null , true )
194+ . SetCategory ( "Script" )
195+ . SetCategory ( "if" )
196+ . SetCategory ( "variable assignation" )
197+ . Returns ( 4 ) ;
67198
68199 #endregion
69200
70201 #region block for lambda body
71202
72- yield return new TestCaseData ( Resources . Script0006 , null , true ) . SetCategory ( "Script" ) . SetCategory ( "lambda" ) . SetCategory ( "variable assignation" ) . SetCategory ( "block for lambda body" ) . Returns ( 3 ) ;
73- yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0006 , "" ) , null , true ) . SetCategory ( "Script" ) . SetCategory ( "lambda" ) . SetCategory ( "variable assignation" ) . SetCategory ( "block for lambda body" ) . Returns ( 3 ) ;
74-
203+ yield return new TestCaseData ( Resources . Script0006 , null , true )
204+ . SetCategory ( "Script" )
205+ . SetCategory ( "lambda" )
206+ . SetCategory ( "variable assignation" )
207+ . SetCategory ( "block for lambda body" )
208+ . Returns ( 3 ) ;
209+ yield return new TestCaseData ( removeAllWhiteSpacesRegex . Replace ( Resources . Script0006 , "" ) , null , true )
210+ . SetCategory ( "Script" )
211+ . SetCategory ( "lambda" )
212+ . SetCategory ( "variable assignation" )
213+ . SetCategory ( "block for lambda body" )
214+ . Returns ( 3 ) ;
215+
216+ #endregion
217+
218+ #region More complex script
219+
220+ yield return new TestCaseData ( Resources . Script0007 , null , true )
221+ . SetCategory ( "Script" )
222+ . SetCategory ( "lambda" )
223+ . SetCategory ( "variable assignation" )
224+ . SetCategory ( "if" )
225+ . SetCategory ( "block for lambda body" )
226+ . Returns ( 13 ) ;
227+
75228 #endregion
76229 }
77230 }
0 commit comments