blob: 7ea7071e7c666674f3f1f9c5084afd380974a1f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
namespace NUnit.Runner {
using System;
using System.Reflection;
using System.IO;
using System.Security;
/// <summary>The standard test suite loader. It can only load the same
/// class once.</summary>
public class StandardTestSuiteLoader: ITestSuiteLoader {
/// <summary>
///
/// </summary>
/// <param name="suiteClassName"></param>
/// <returns></returns>
public Type Load(string suiteClassName) {
Type testClass;
string[] classSpec=suiteClassName.Split(',');
if (classSpec.Length > 1) {
FileInfo dll=new FileInfo(classSpec[1]);
if (!dll.Exists)
throw new FileNotFoundException("File " + dll.FullName + " not found", dll.FullName);
Assembly a = Assembly.LoadFrom(dll.FullName);
testClass=a.GetType(classSpec[0], true);
}
else
testClass = Type.GetType(suiteClassName, true);
return testClass;
}
/// <summary>
///
/// </summary>
/// <param name="aClass"></param>
/// <returns></returns>
public Type Reload(Type aClass) {
return aClass;
}
}
}
|