예제 #1
0
        private static void StartMethod(Type type, string methodName, object[] parameters)
        {
            var methods  = type.GetMethods();
            var instance = Activator.CreateInstance(type);

            StackTraceExtensions.SetUnitTestName(type.FullName + "." + methodName);
            RunMethodWithAttribute(instance, methods, SetUpAttribute);
            methods.FirstOrDefault(method => method.Name == methodName).Invoke(instance, parameters);
            RunMethodWithAttribute(instance, methods, TearDownAttribute);
        }
 public static string GetEntryAssemblyForProjectName()
 {
     return(projectName ?? (projectName = StackTraceExtensions.GetExecutingAssemblyName()));
 }
 //ncrunch: no coverage start
 public static string GetTestNameOrProjectName()
 {
     return(testOrProjectName ?? (testOrProjectName = StackTraceExtensions.GetEntryName()));
 }