예제 #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public TestArgumentListAttribute(TestArgumentListCallback listCallback)
 {
     if (listCallback == null)
     {
         throw new ArgumentNullException("listCallback");
     }
     _listCallback = listCallback;
 }
예제 #2
0
 /// <summary>
 /// Gets or sets the arguments to pass to a test.
 /// </summary>
 public override List <object[]> GetParameters(ITest test)
 {
     if (_listCallback == null)
     {
         MethodInfo method = test.Fixture.FixtureType.GetMethod(_listCallbackMethodName,
                                                                BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
         if (!method.IsStatic)
         {
             _listCallback = (TestArgumentListCallback)Delegate.CreateDelegate(
                 typeof(TestArgumentListCallback), test.Fixture.Instance, method);
         }
         else
         {
             _listCallback = (TestArgumentListCallback)Delegate.CreateDelegate(
                 typeof(TestArgumentListCallback), method);
         }
     }
     return(_listCallback());
 }