示例#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));
        }
示例#2
0
 public static NUnitTestMethod MakeTestCase(Type type, string methodName)
 {
     return((NUnitTestMethod)testBuilder.BuildFrom(Reflect.GetNamedMethod(
                                                       type,
                                                       methodName,
                                                       BindingFlags.Public | BindingFlags.Instance)));
 }
示例#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));
        }
示例#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));
        }