1
// *********************************************************************
2
// Copyright 2007, Andreas Schlapsi
3
// This is free software licensed under the MIT license.
4
// *********************************************************************
6
using System.Reflection;
9
namespace NUnitExtension.RowTest.AddIn
11
public sealed class RowTestFramework
13
public const string RowTestAttribute = "NUnitExtension.RowTest.RowTestAttribute";
14
public const string RowAttribute = "NUnitExtension.RowTest.RowAttribute";
15
public const string SpecialValueEnum = "NUnitExtension.RowTest.SpecialValue";
17
private RowTestFramework()
21
public static bool IsRowTest(MethodInfo method)
26
return Reflect.HasAttribute(method, RowTestAttribute, false);;
29
public static Attribute[] GetRowAttributes(MethodInfo method)
32
throw new ArgumentNullException("method");
34
return Reflect.GetAttributes(method, RowAttribute, false);
37
public static object[] GetRowArguments(Attribute attribute)
39
return Reflect.GetPropertyValue(attribute, "Arguments") as object[];
42
public static bool IsSpecialValue(object argument)
47
return argument.GetType().FullName == SpecialValueEnum;
50
public static Type GetExpectedExceptionType(Attribute attribute)
52
return Reflect.GetPropertyValue(attribute, "ExpectedException") as Type;
55
public static string GetExpectedExceptionMessage(Attribute attribute)
57
return Reflect.GetPropertyValue(attribute, "ExceptionMessage") as string;
60
public static string GetTestName(Attribute attribute)
62
return Reflect.GetPropertyValue(attribute, "TestName") as string;