Skip to content

Commit 6512bc6

Browse files
authored
Merge pull request #118 from codingseb/dev
Dev
2 parents d5932a7 + 0ab8b35 commit 6512bc6

File tree

8 files changed

+257
-215
lines changed

8 files changed

+257
-215
lines changed

CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,40 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
587587
.SetCategory("??=")
588588
.Returns("First Null-coalescing assignation");
589589

590+
#endregion
591+
592+
#region Implicit cast when assign
593+
594+
ExpressionEvaluator evaluator0012 = new ExpressionEvaluator();
595+
596+
yield return new TestCaseData("ushort x = 2;",
597+
evaluator0012,
598+
null,
599+
new Action(() => evaluator0012.Variables["x"].ShouldBe(2)), null)
600+
.SetCategory("Script")
601+
.SetCategory("Variable assignation")
602+
.SetCategory("=")
603+
.Returns(2);
604+
605+
yield return new TestCaseData("double y = 3;",
606+
evaluator0012,
607+
null,
608+
new Action(() => evaluator0012.Variables["y"].ShouldBe(3)), null)
609+
.SetCategory("Script")
610+
.SetCategory("Variable assignation")
611+
.SetCategory("=")
612+
.Returns(3);
613+
614+
//yield return new TestCaseData("float z = 3.2;",
615+
// evaluator0012,
616+
// null,
617+
// new Action(() => ((float)evaluator0012.Variables["z"]).ShouldBe(3.2f, 0.001)), null)
618+
//.SetCategory("Script")
619+
//.SetCategory("Variable assignation")
620+
//.SetCategory("=")
621+
//.Returns();
622+
623+
590624
#endregion
591625

592626
#region Array content assignation
@@ -1507,23 +1541,23 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
15071541
.SetCategory("new Exception must not throw the exception")
15081542
.Returns(3);
15091543

1510-
yield return new TestCaseData(Resources.Script0072, null, null, null, null)
1544+
yield return new TestCaseData(Resources.Script0102, null, null, null, null)
15111545
.SetCategory("Script")
15121546
.SetCategory("variable with prefix 'test'")
15131547
.SetCategory("new function test")
15141548
.SetCategory("Bug")
15151549
.SetCategory("#116")
15161550
.Returns("hello");
15171551

1518-
yield return new TestCaseData(Resources.Script0073, null, null, null, null)
1552+
yield return new TestCaseData(Resources.Script0103, null, null, null, null)
15191553
.SetCategory("Script")
15201554
.SetCategory("variable with prefix 'test'")
15211555
.SetCategory("new instance test")
15221556
.SetCategory("Bug")
15231557
.SetCategory("#116")
15241558
.Returns("hello");
15251559

1526-
yield return new TestCaseData(Resources.Script0074, null, null, null, null)
1560+
yield return new TestCaseData(Resources.Script0104, null, null, null, null)
15271561
.SetCategory("Script")
15281562
.SetCategory("variable with prefix 'test'")
15291563
.SetCategory("Bug")

0 commit comments

Comments
 (0)