Skip to content

Commit c0994f4

Browse files
committed
Scripts tests with out keyword
1 parent a94d3b6 commit c0994f4

File tree

6 files changed

+64
-1
lines changed

6 files changed

+64
-1
lines changed

CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,16 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
14101410
.SetCategory("List function")
14111411
.Returns("[6,4,10,6,10,4]");
14121412

1413+
yield return new TestCaseData(Resources.Script0100, new ExpressionEvaluator(), null, null, null)
1414+
.SetCategory("Script")
1415+
.SetCategory("OutKeywordMethod")
1416+
.Returns(5);
1417+
1418+
yield return new TestCaseData(Resources.Script0101, new ExpressionEvaluator(), null, null, null)
1419+
.SetCategory("Script")
1420+
.SetCategory("OutKeywordMethod")
1421+
.Returns(5);
1422+
14131423
#endregion
14141424

14151425
#region For Bug correction (no regression)

CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,9 +2223,10 @@ public void EvaluateWithSubExpressionsVariables()
22232223

22242224
#endregion
22252225

2226-
#region method with out parameter
2226+
#region Method with out parameter
22272227

22282228
[Test]
2229+
[Category("OutKeywordMethod")]
22292230
public void MethodWithOutParameter()
22302231
{
22312232
ExpressionEvaluator evaluator = new ExpressionEvaluator();
@@ -2246,6 +2247,7 @@ public void MethodWithOutParameter()
22462247
}
22472248

22482249
[Test]
2250+
[Category("OutKeywordMethod")]
22492251
public void MethodWithOutParameterWithoutExistingVariable()
22502252
{
22512253
ExpressionEvaluator evaluator = new ExpressionEvaluator();
@@ -2264,6 +2266,7 @@ public void MethodWithOutParameterWithoutExistingVariable()
22642266
}
22652267

22662268
[Test]
2269+
[Category("OutKeywordMethod")]
22672270
public void MethodWithOutParameterInlineVarDeclaration()
22682271
{
22692272
ExpressionEvaluator evaluator = new ExpressionEvaluator();

CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CodingSeb.ExpressionEvaluator.Tests/Resources.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,4 +331,10 @@
331331
<data name="Script0071" type="System.Resources.ResXFileRef, System.Windows.Forms">
332332
<value>resources\script0071.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
333333
</data>
334+
<data name="Script0100" type="System.Resources.ResXFileRef, System.Windows.Forms">
335+
<value>resources\script0100.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
336+
</data>
337+
<data name="Script0101" type="System.Resources.ResXFileRef, System.Windows.Forms">
338+
<value>resources\script0101.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
339+
</data>
334340
</root>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* Script0100 */
2+
var dictionary = new Dictionary<string, object>();
3+
dictionary.Add("x", 5);
4+
object number = null;
5+
if (dictionary.TryGetValue("x", out number))
6+
return number;
7+
return 0;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* Script0101 */
2+
var dictionary = new Dictionary<string, object>();
3+
dictionary.Add("x", 5);
4+
object number = 10;
5+
if (dictionary.TryGetValue("x", out number))
6+
return number;
7+
return 0;

0 commit comments

Comments
 (0)