Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
using System.Reflection;
using NUnit.Core;
using NUnit.Core.Extensibility;
namespace NUnit.Core.Extensions.RowTest
{
[NUnitAddin(Name = "Row Test Extension")]
public class RowTestAddIn : IAddin, ITestCaseBuilder
{
private RowTestFactory _testFactory;
public RowTestAddIn()
{
_testFactory = new RowTestFactory();
}
public bool Install(IExtensionHost host)
{
if (host == null)
throw new ArgumentNullException("host");
IExtensionPoint testCaseBuilders = host.GetExtensionPoint("TestCaseBuilders");
if (testCaseBuilders == null)
return false;
testCaseBuilders.Install(this);
return true;
}
public bool CanBuildFrom(MethodInfo method)
{
return RowTestFramework.IsRowTest(method);
}
public Test BuildFrom(MethodInfo method)
{
if (method == null)
throw new ArgumentNullException("method");
RowTestSuite suite = _testFactory.CreateRowTestSuite(method);
Attribute[] rows = RowTestFramework.GetRowAttributes(method);
foreach (Attribute row in rows)
suite.Add(_testFactory.CreateRowTestCase(row, method));
return suite;
}
}
}