Пример #1
0
        // Finding namespace1.namespace2.Type1.Type2.Type3.Method
        public void InvokingMethodTest()
        {
            string   fullMethodName     = "namespace1.namespace2.Type1.Type2.Type3.Method";
            object   context            = new namespace1.namespace2.Type1.Type2.Type3();
            Assembly asm                = Assembly.GetExecutingAssembly();
            AssembliesAccessWrapper aaw = new AssembliesAccessWrapper(new Assembly[] { asm });

            // Invoke 2-arg method
            CheckInvokationResultCorrectness(aaw.InvokeMethod(fullMethodName, context, new object[] { 1, 2 }), 1, "problem with invocation of the 2-arg method", "Wrong type of the result of invocation");

            // Invoke 2-arg static method as a static method
            CheckInvokationResultCorrectness(aaw.InvokeMethod(fullMethodName, null, new object[] { 1, 2 }), 1, "problem with invocation of the 2-arg method", "Wrong type of the result of invocation");

            // Invoke 1-arg method
            CheckInvokationResultCorrectness(aaw.InvokeMethod(fullMethodName, context, new object[] { 1 }), 2, "problem with invocation of the 1-arg method", "Wrong type of the result of invocation");

            // Invoke 0-arg method
            CheckInvokationResultCorrectness(aaw.InvokeMethod(fullMethodName, context, new object[] { }), 3, "problem with invocation of the 0-arg method", "Wrong type of the result of invocation");

            // Invoke 1-arg generic method
            //CheckInvokationResultCorrectness(aaw.InvokeMethod(fullMethodName, context, new object[] { "abc" }), 4, "problem with invocation of the 0-arg method", "Wrong type of the result of invocation");
        }
Пример #2
0
 public void Setup()
 {
     namespace1.namespace2.Type1.Type2.Type3 a = new namespace1.namespace2.Type1.Type2.Type3();
     //namespace1.namespace2.Type1.Type4.Type5 b = new namespace1.namespace2.Type1.Type4.Type5();
 }