public void ArgumentsToDictionaryShouldApplyOrdinalNamesToFirstArguments() { var binder = new TestInvokeMemberBinder("Test", false, new CallInfo(2, "Foo")); var actual = binder.ArgumentsToDictionary(new object[] { 1, 2 }); Assert.AreEqual("_0", actual.First().Key); }
public void NamedArgumentsToDictionaryShouldApplyNamesToLastArguments() { var binder = new TestInvokeMemberBinder("Test", false, new CallInfo(2, "Foo")); var actual = binder.NamedArgumentsToDictionary(new object[] { 1, 2 }); Assert.AreEqual(2, actual["Foo"]); }
public void ArgumentsToDictionaryShouldReturnInputParameterWhenInputParameterIsDictionary() { var binder = new TestInvokeMemberBinder("Test", false, new CallInfo(1, "Foo")); var input = new Dictionary<string, object> { { "Test1", 1 }, { "Test2", 2 } }; var actual = binder.ArgumentsToDictionary(new object[] { input }); Assert.AreEqual(input["Test2"], actual["Test2"]); }
public void ArgumentsToDictionaryShouldReturnInputParameterWhenInputParameterIsDictionary() { var binder = new TestInvokeMemberBinder("Test", false, new CallInfo(1, "Foo")); var input = new Dictionary <string, object> { { "Test1", 1 }, { "Test2", 2 } }; var actual = binder.ArgumentsToDictionary(new object[] { input }); Assert.AreEqual(input["Test2"], actual["Test2"]); }
public void ArgumentsToDictionaryShouldApplyOrdinalNamesToFirstArguments() { var binder = new TestInvokeMemberBinder("Test", false, new CallInfo(2, "Foo")); var actual = binder.ArgumentsToDictionary(new object[] { 1, 2 }); Assert.AreEqual("_0", actual.First().Key); }
public void NamedArgumentsToDictionaryShouldApplyNamesToLastArguments() { var binder = new TestInvokeMemberBinder("Test", false, new CallInfo(2, "Foo")); var actual = binder.NamedArgumentsToDictionary(new object[] {1, 2}); Assert.AreEqual(2, actual["Foo"]); }