Пример #1
0
        public void TestInit()
        {
            this.mockReflectHelper   = new Mock <ReflectHelper>();
            this.testMethodValidator = new TestMethodValidator(this.mockReflectHelper.Object);
            this.warnings            = new List <string>();

            this.mockMethodInfo = new Mock <MethodInfo>();
            this.type           = typeof(TestMethodValidatorTests);
        }
Пример #2
0
        public void WhenDiscoveryOfInternalsIsEnabledIsValidTestMethodShouldReturnFalseForPrivateMethods()
        {
            this.SetupTestMethod();
            var methodInfo = typeof(DummyTestClass).GetMethod(
                "PrivateTestMethod",
                BindingFlags.Instance | BindingFlags.NonPublic);

            var testMethodValidator = new TestMethodValidator(this.mockReflectHelper.Object, true);

            Assert.IsFalse(testMethodValidator.IsValidTestMethod(methodInfo, typeof(DummyTestClass), this.warnings));
        }