Пример #1
0
        public void GetConstructorInfo_NoArgs()
        {
            ConstructorInfo info = InfoHelper.GetConstructorInfo(() => new InfoHelperClass());

            Assert.IsNotNull(info);
            Assert.AreEqual(info.GetParameters().Length, 0);
        }
Пример #2
0
        public void GetConstructorInfo_Args()
        {
            ConstructorInfo info =
                InfoHelper.GetConstructorInfo(() => new InfoHelperClass(default(string), default(int)));

            Assert.IsNotNull(info);
            Assert.AreEqual(info.GetParameters().Length, 2);
        }
Пример #3
0
        public void GetConstructorInfo_InvalidThrowIfNotFoundThrows()
        {
            ConstructorInfo info = InfoHelper.GetConstructorInfo(() => _helper, true);

            Assert.Fail("Didn't throw");
        }
Пример #4
0
        public void GetConstructorInfo_Invalid()
        {
            ConstructorInfo info = InfoHelper.GetConstructorInfo(() => _helper);

            Assert.IsNull(info);
        }