Exemplo n.º 1
0
 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"]);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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"]);
        }
Exemplo n.º 4
0
 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);
 }