示例#1
0
 public void GetsStaticConstructor()
 {
     var flags = System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic;
       var obj = new HasStaticCtor();
       var ctor = GetConstructor(obj.GetType(), flags, null, new Type[] { }, null);
       Assert.IsNotNull(ctor);
       Assert.IsTrue(ctor.IsStatic);
 }
示例#2
0
        public void GetsInstanceConstructor()
        {
            var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic;
            var obj   = new HasStaticCtor();
            var ctor  = GetConstructor(obj.GetType(), flags, null, new Type[] { }, null);

            Assert.IsNotNull(ctor);
            Assert.IsFalse(ctor.IsStatic);
        }