Exemplo n.º 1
0
        public void FastReflectionMethodsStatic()
        {
            var fastReflection = new FastReflection();

            var instance = "123";
            var result   = fastReflection.InvokeStaticMethod(typeof(int), nameof(int.Parse), instance);

            Assert.AreEqual(123, result);

            try
            {
                fastReflection.InvokeStaticMethod(typeof(MockValue), nameof(MockValue.VoidMethod));
                Assert.Fail();
            }
            catch (NullReferenceException)
            {
            }
            catch
            {
                Assert.Fail();
            }
        }