Skip to content

Commit 7e722d8

Browse files
spahnkeoliverbock
authored andcommitted
Revise tests and add test case for omitting default parameters in the middle using undefined
1 parent 8715a39 commit 7e722d8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Tests/Noesis.Javascript.Tests/ConvertFromJavascriptTests.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public string methodWithDefaultParameter(string s = "")
3636
return s;
3737
}
3838

39-
public string methodWithRequiredAndDefaultParameters(int i, string s = "", bool b = true)
39+
public string methodWithRequiredAndDefaultParameters(int i, string s = "abc", bool b = true)
4040
{
4141
return String.Format("i: {0}, s: {1}, b: {2}", i, s, b);
4242
}
@@ -258,7 +258,7 @@ public void MethodCallWithRequiredAndDefaultParameters_PassingNoOptionalActualPa
258258
_context.SetParameter("obj", obj);
259259
var result = _context.Run("obj.methodWithRequiredAndDefaultParameters(1)");
260260

261-
result.Should().Be("i: 1, s: , b: True");
261+
result.Should().Be("i: 1, s: abc, b: True");
262262
}
263263

264264
[TestMethod]
@@ -270,5 +270,16 @@ public void MethodCallWithRequiredAndDefaultParameters_PassingAllActualParameter
270270

271271
result.Should().Be("i: 1, s: test, b: False");
272272
}
273+
274+
[TestMethod]
275+
[Ignore]
276+
public void MethodCallWithRequiredAndDefaultParameters_PassingOnlyOneOptionalActualParameterLeavingTheMiddleOneUndefined()
277+
{
278+
var obj = new TypedPropertiesClass();
279+
_context.SetParameter("obj", obj);
280+
var result = _context.Run("obj.methodWithRequiredAndDefaultParameters(1, undefined, false)");
281+
282+
result.Should().Be("i: 1, s: abc, b: False");
283+
}
273284
}
274285
}

0 commit comments

Comments
 (0)