public void AddEventHandlerToPerson()
        {
            NameListener listener = new NameListener();
            Person person = new Person() { FirstName = "Adam" };
            FunctionWrapper<string, int, MyEvent> wrapper = new FunctionWrapper<string, int, MyEvent>(listener, null);
            typeof(Person).GetEvent("NameEvent").AddEventHandler(person, wrapper.CreateFunctionDelegate());
            person.GetName();

            Assert.AreEqual(4, listener.Length);
            Assert.AreEqual("Adam", listener.Name);
        }
        public void InvokeFunctionWrapper()
        {
            FunctionWrapper<int, int, int, Func<int, int, int>> wrapper = new FunctionWrapper<int, int, int, Func<int, int, int>>(new Adder(), null);

            var result = wrapper.CreateFunctionDelegate().DynamicInvoke(2, 3);

            Assert.IsNotNull(result);
            Assert.AreEqual(5, result);
        }