Beispiel #1
0
        public void Tests(MethodInfo method, RunState state)
        {
            Test built = _sut.BuildFrom(method);

            Assert.That(built, Is.InstanceOf(typeof(NUnitTestMethod)));
            Assert.That(built.RunState, Is.EqualTo(state));
        }
Beispiel #2
0
 public static NUnitTestMethod MakeTestCase(Type type, string methodName)
 {
     return((NUnitTestMethod)testBuilder.BuildFrom(Reflect.GetNamedMethod(
                                                       type,
                                                       methodName,
                                                       BindingFlags.Public | BindingFlags.Instance)));
 }
Beispiel #3
0
        public static Test MakeTestCase(Type type, string methodName)
        {
            MethodInfo method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            if (method == null)
            {
                Assert.Fail("Method not found: " + methodName);
            }
            return(testBuilder.BuildFrom(method));
        }
Beispiel #4
0
        public static Test MakeTestCase(Type type, string methodName)
        {
            MethodInfo method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            if (method == null)
            {
                Assert.Fail("Unable to find method {0} in type {1}", methodName, type.FullName);
            }
            return(testBuilder.BuildFrom(method));
        }