blob: ebdd9565760529b4d4f8bd34b5642044452b5e3e (
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
40
41
42
43
44
45
46
47
|
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>
[Obsolete("Use StandardLoader or UnloadingLoader")]
public class StandardTestSuiteLoader: ITestSuiteLoader
{
/// <summary>
/// Loads
/// </summary>
/// <param name="testClassName"></param>
/// <returns></returns>
public Type Load(string testClassName)
{
Type testClass;
string[] classSpec=testClassName.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(testClassName, true);
return testClass;
}
/// <summary>
///
/// </summary>
/// <param name="aClass"></param>
/// <returns></returns>
public Type Reload(Type aClass)
{
return aClass;
}
}
}
|