public void FastReflectionPropertiesStatic() { var fastReflection = new FastReflection(); fastReflection.SetStaticProperty(typeof(MockValue), nameof(MockValue.StaticFoo), 123); Assert.AreEqual(123, fastReflection.GetStaticPropertyOrEnum(typeof(MockValue), nameof(MockValue.StaticFoo))); }
public void FastReflectionEnum() { var fastReflection = new FastReflection(); Assert.AreEqual(System.IO.FileMode.CreateNew, fastReflection.GetStaticPropertyOrEnum(typeof(System.IO.FileMode), nameof(System.IO.FileMode.CreateNew))); try { fastReflection.GetStaticPropertyOrEnum(typeof(System.IO.FileMode), "Hello"); Assert.Fail(); } catch (ArgumentException) { } catch (Exception) { Assert.Fail(); } }