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,14 @@
// ****************************************************************
// This is free software licensed under the NUnit license. You
// may obtain a copy of the license as well as information regarding
// copyright ownership at http://nunit.org/?p=license&r=2.4.
// ****************************************************************
using System;
using System.Reflection;
[assembly: CLSCompliant(true)]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../../nunit.snk")]
[assembly: AssemblyKeyName("")]

View File

@@ -0,0 +1,32 @@
thisdir = nunit24/NUnitExtensions/core
SUBDIRS =
include ../../../build/rules.make
LIBRARY = nunit.core.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
LIB_MCS_FLAGS = \
-debug \
/r:nunit.core.dll /r:nunit.core.interfaces.dll \
/r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
NO_TEST = yo
ifneq (net_2_0, $(PROFILE))
NO_INSTALL = yes
install-local: install-symlink
uninstall-local: uninstall-symlink
endif
EXTRA_DISTFILES = \
nunit.core.extensions.dll.csproj \
nunit.core.extensions.dll_VS2005.csproj
include ../../../build/library.make
symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
install-symlink:
$(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir)
cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME)
uninstall-symlink:
rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME)

View File

@@ -0,0 +1,39 @@
// ****************************************************************
// Copyright 2007, Charlie Poole
// This is free software licensed under the NUnit license. You may
// obtain a copy of the license at http://nunit.org/?p=license&r=2.4
// ****************************************************************
using System;
using System.Reflection;
namespace NUnit.Core.Extensions
{
/// <summary>
/// RepeatedTestCase aggregates another test case and runs it
/// a specified number of times.
/// </summary>
public class RepeatedTestCase : AbstractTestCaseDecoration
{
// The number of times to run the test
int count;
public RepeatedTestCase( TestCase testCase, int count )
: base( testCase )
{
this.count = count;
}
public override void Run(TestCaseResult result)
{
// So testCase can get the fixture
testCase.Parent = this.Parent;
for( int i = 0; i < count; i++ )
{
testCase.Run( result );
if ( result.IsFailure )
return;
}
}
}
}

View File

@@ -0,0 +1,63 @@
// ****************************************************************
// Copyright 2007, Charlie Poole
// This is free software licensed under the NUnit license. You may
// obtain a copy of the license at http://nunit.org/?p=license&r=2.4
// ****************************************************************
using System;
using System.Reflection;
using NUnit.Core.Extensibility;
namespace NUnit.Core.Extensions
{
/// <summary>
/// Summary description for RepeatedTestDecorator.
/// </summary>
[NUnitAddin(Description="Runs a test case multiple times")]
public class RepeatedTestDecorator : ITestDecorator, IAddin
{
private static readonly string RepeatAttributeType = "NUnit.Framework.Extensions.RepeatAttribute";
#region IAddin Members
public bool Install(IExtensionHost host)
{
IExtensionPoint decorators = host.GetExtensionPoint( "TestDecorators" );
if ( decorators == null )
return false;
decorators.Install( this );
return true;
}
#endregion
#region ITestDecorator Members
public Test Decorate(Test test, MemberInfo member)
{
if ( member == null )
return test;
TestCase testCase = test as TestCase;
if ( testCase == null )
return test;
Attribute repeatAttr = Reflect.GetAttribute( member, RepeatAttributeType, true );
if ( repeatAttr == null )
return test;
object propVal = Reflect.GetPropertyValue( repeatAttr, "Count",
BindingFlags.Public | BindingFlags.Instance );
if ( propVal == null )
return test;
int count = (int)propVal;
return new RepeatedTestCase( testCase, count );
}
// public Test Decorate( Test test, Type fixtureType )
// {
// return test;
// }
#endregion
}
}

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;
}
}
}

View File

@@ -0,0 +1,37 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
using System.Reflection;
using System.Text;
using NUnit.Core;
namespace NUnit.Core.Extensions.RowTest
{
public class RowTestCase : NUnitTestMethod
{
private object[] _arguments;
public RowTestCase(MethodInfo method, string testName, object[] arguments)
: base(method)
{
RowTestNameBuilder testNameBuilder = new RowTestNameBuilder(method, testName, arguments);
this.TestName.Name = testNameBuilder.TestName;
this.TestName.FullName = testNameBuilder.FullTestName;
_arguments = arguments;
}
public object[] Arguments
{
get { return _arguments; }
}
public override void RunTestMethod(TestCaseResult testResult)
{
object[] arguments = _arguments != null ? _arguments : new object[] { null };
Reflect.InvokeMethod(this.Method, this.Fixture, arguments);
}
}
}

View File

@@ -0,0 +1,79 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
using System.Reflection;
using NUnit.Core;
namespace NUnit.Core.Extensions.RowTest
{
public class RowTestFactory
{
public RowTestFactory()
{
}
public RowTestSuite CreateRowTestSuite(MethodInfo method)
{
if (method == null)
throw new ArgumentNullException("method");
RowTestSuite testSuite = new RowTestSuite(method);
NUnitFramework.ApplyCommonAttributes(method, testSuite);
return testSuite;
}
public RowTestCase CreateRowTestCase(Attribute row, MethodInfo method)
{
if (row == null)
throw new ArgumentNullException("row");
if (method == null)
throw new ArgumentNullException("method");
object[] rowArguments = RowTestFramework.GetRowArguments(row);
rowArguments = FilterSpecialValues(rowArguments);
string testName = RowTestFramework.GetTestName(row);
Type expectedExceptionType = RowTestFramework.GetExpectedExceptionType(row);
RowTestCase testCase = new RowTestCase(method, testName, rowArguments);
if (expectedExceptionType != null)
{
testCase.ExceptionExpected = true;
testCase.ExpectedExceptionType = expectedExceptionType;
testCase.ExpectedMessage = RowTestFramework.GetExpectedExceptionMessage(row);
}
return testCase;
}
private object[] FilterSpecialValues(object[] arguments)
{
if (arguments == null)
return null;
for (int i = 0; i < arguments.Length; i++)
{
if (RowTestFramework.IsSpecialValue(arguments[i]))
arguments[i] = MapSpecialValue(arguments[i]);
}
return arguments;
}
private object MapSpecialValue(object specialValue)
{
switch (specialValue.ToString())
{
case "Null":
return null;
default:
return specialValue;
}
}
}
}

View File

@@ -0,0 +1,65 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
using System.Reflection;
using NUnit.Core;
namespace NUnit.Core.Extensions.RowTest
{
public sealed class RowTestFramework
{
public const string RowTestAttribute = "NUnit.Framework.Extensions.RowTestAttribute";
public const string RowAttribute = "NUnit.Framework.Extensions.RowAttribute";
public const string SpecialValueEnum = "NUnit.Framework.Extensions.SpecialValue";
private RowTestFramework()
{
}
public static bool IsRowTest(MethodInfo method)
{
if (method == null)
return false;
return Reflect.HasAttribute(method, RowTestAttribute, false);;
}
public static Attribute[] GetRowAttributes(MethodInfo method)
{
if (method == null)
throw new ArgumentNullException("method");
return Reflect.GetAttributes(method, RowAttribute, false);
}
public static object[] GetRowArguments(Attribute attribute)
{
return Reflect.GetPropertyValue(attribute, "Arguments") as object[];
}
public static bool IsSpecialValue(object argument)
{
if (argument == null)
return false;
return argument.GetType().FullName == SpecialValueEnum;
}
public static Type GetExpectedExceptionType(Attribute attribute)
{
return Reflect.GetPropertyValue(attribute, "ExpectedException") as Type;
}
public static string GetExpectedExceptionMessage(Attribute attribute)
{
return Reflect.GetPropertyValue(attribute, "ExceptionMessage") as string;
}
public static string GetTestName(Attribute attribute)
{
return Reflect.GetPropertyValue(attribute, "TestName") as string;
}
}
}

View File

@@ -0,0 +1,92 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
using System.Reflection;
using System.Text;
namespace NUnit.Core.Extensions.RowTest
{
public class RowTestNameBuilder
{
private MethodInfo _method;
private string _baseTestName;
private object[] _arguments;
private string _argumentList;
public RowTestNameBuilder(MethodInfo method, string baseTestName, object[] arguments)
{
_method = method;
_baseTestName = baseTestName;
_arguments = arguments;
}
public MethodInfo Method
{
get { return _method; }
}
public string BaseTestName
{
get { return _baseTestName; }
}
public object[] Arguments
{
get { return _arguments; }
}
public string TestName
{
get
{
string baseTestName = _baseTestName;
if (baseTestName == null || baseTestName.Length == 0)
baseTestName = _method.Name;
return baseTestName + GetArgumentList();
}
}
public string FullTestName
{
get { return _method.DeclaringType.FullName + "." + TestName; }
}
private string GetArgumentList()
{
if (_argumentList == null)
_argumentList = "(" + CreateArgumentList() + ")";
return _argumentList;
}
private string CreateArgumentList()
{
if (_arguments == null)
return "null";
StringBuilder argumentListBuilder = new StringBuilder();
for (int i = 0; i < _arguments.Length; i++)
{
if (i > 0)
argumentListBuilder.Append(", ");
argumentListBuilder.Append (GetArgumentString (_arguments[i]));
}
return argumentListBuilder.ToString();
}
private string GetArgumentString (object argument)
{
if (argument == null)
return "null";
return argument.ToString();
}
}
}

View File

@@ -0,0 +1,50 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
using System.Reflection;
using NUnit.Core;
namespace NUnit.Core.Extensions.RowTest
{
public class RowTestSuite : TestSuite
{
private static string GetParentName(MethodInfo method)
{
if (method == null)
throw new ArgumentNullException("method");
return method.DeclaringType.ToString();
}
private static string GetTestName(MethodInfo method)
{
if (method == null)
throw new ArgumentNullException("method");
return method.Name;
}
public RowTestSuite(MethodInfo method)
: base (GetParentName(method), GetTestName(method))
{
}
public override TestResult Run(EventListener listener, ITestFilter filter)
{
if (this.Parent != null)
this.Fixture = this.Parent.Fixture;
return base.Run(listener, filter);
}
protected override void DoOneTimeSetUp(TestResult suiteResult)
{
}
protected override void DoOneTimeTearDown(TestResult suiteResult)
{
}
}
}

View File

@@ -0,0 +1,151 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{98B10E98-003C-45A0-9587-119142E39986}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "nunit.core.extensions"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "NUnit.Core.Extensions"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "true"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
/>
<Reference
Name = "nunit.core.dll"
Project = "{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "nunit.core.interfaces.dll"
Project = "{435428F8-5995-4CE4-8022-93D595A8CC0F}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "CommonAssemblyInfo.cs"
Link = "..\..\CommonAssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RepeatedTestCase.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RepeatedTestDecorator.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RowTest\RowTestAddIn.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RowTest\RowTestCase.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RowTest\RowTestFactory.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RowTest\RowTestFramework.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RowTest\RowTestNameBuilder.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "RowTest\RowTestSuite.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,10 @@
../../CommonAssemblyInfo.cs
AssemblyInfo.cs
RepeatedTestCase.cs
RepeatedTestDecorator.cs
RowTest/RowTestAddIn.cs
RowTest/RowTestCase.cs
RowTest/RowTestFactory.cs
RowTest/RowTestFramework.cs
RowTest/RowTestNameBuilder.cs
RowTest/RowTestSuite.cs

View File

@@ -0,0 +1,85 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{98B10E98-003C-45A0-9587-119142E39986}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>nunit.core.extensions</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>NUnit.Core.Extensions</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release2005|AnyCPU' ">
<OutputPath>bin\Release2005\</OutputPath>
<DefineConstants>TRACE;VS2005</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug2005|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug2005\</OutputPath>
<DefineConstants>TRACE;DEBUG;VS2005</DefineConstants>
<BaseAddress>285212672</BaseAddress>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\CommonAssemblyInfo.cs">
<Link>CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="RepeatedTestCase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RepeatedTestDecorator.cs" />
<Compile Include="RowTest\RowTestAddIn.cs" />
<Compile Include="RowTest\RowTestCase.cs" />
<Compile Include="RowTest\RowTestFactory.cs" />
<Compile Include="RowTest\RowTestFramework.cs" />
<Compile Include="RowTest\RowTestNameBuilder.cs" />
<Compile Include="RowTest\RowTestSuite.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\NUnitCore\core\nunit.core.dll_VS2005.csproj">
<Project>{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}</Project>
<Name>nunit.core.dll_VS2005</Name>
</ProjectReference>
<ProjectReference Include="..\..\NUnitCore\interfaces\nunit.core.interfaces.dll_VS2005.csproj">
<Project>{DCC88998-255A-4247-B658-71DD932E9873}</Project>
<Name>nunit.core.interfaces.dll_VS2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,14 @@
// ****************************************************************
// Copyright 2007, Charlie Poole
// This is free software licensed under the NUnit license. You may
// obtain a copy of the license at http://nunit.org/?p=license&r=2.4
// ****************************************************************
using System;
using System.Reflection;
[assembly: CLSCompliant(true)]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../../nunit.snk")]
[assembly: AssemblyKeyName("")]

View File

@@ -0,0 +1,29 @@
thisdir = nunit24/NUnitExtensions/framework
SUBDIRS =
include ../../../build/rules.make
LIBRARY = nunit.framework.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
LIB_MCS_FLAGS = -debug /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
NO_TEST = yo
ifneq (net_2_0, $(PROFILE))
NO_INSTALL = yes
install-local: install-symlink
uninstall-local: uninstall-symlink
endif
EXTRA_DISTFILES = \
nunit.framework.extensions.dll.csproj \
nunit.framework.extensions.dll_VS2005.csproj
include ../../../build/library.make
symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
install-symlink:
$(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir)
cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME)
uninstall-symlink:
rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME)

View File

@@ -0,0 +1,37 @@
// ****************************************************************
// Copyright 2007, Charlie Poole
// This is free software licensed under the NUnit license. You may
// obtain a copy of the license at http://nunit.org/?p=license&r=2.4
// ****************************************************************
using System;
namespace NUnit.Framework.Extensions
{
/// <summary>
/// RepeatAttribute may be applied to test case in order
/// to run it multiple times.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
public class RepeatAttribute : Attribute
{
private int count;
/// <summary>
/// Construct a RepeatAttribute
/// </summary>
/// <param name="count">The number of times to run the test</param>
public RepeatAttribute(int count)
{
this.count = count;
}
/// <summary>
/// Gets the number of times to run the test.
/// </summary>
public int Count
{
get { return count; }
}
}
}

View File

@@ -0,0 +1,67 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
namespace NUnitExtension.RowTest
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class RowAttribute : Attribute
{
private string _testName;
private object[] _arguments;
private string _description;
private Type _expectedExceptionType;
private string _exceptionMessage;
public RowAttribute(object argument1)
{
_arguments = new object[] { argument1 };
}
public RowAttribute(object argument1, object argument2)
{
_arguments = new object[] { argument1, argument2 };
}
public RowAttribute(object argument1, object argument2, object argument3)
{
_arguments = new object[] { argument1, argument2, argument3 };
}
public RowAttribute(params object[] arguments)
{
_arguments = arguments;
}
public string TestName
{
get { return _testName; }
set { _testName = value; }
}
public object[] Arguments
{
get { return _arguments; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
public Type ExpectedException
{
get { return _expectedExceptionType; }
set { _expectedExceptionType = value; }
}
public string ExceptionMessage
{
get { return _exceptionMessage; }
set { _exceptionMessage = value; }
}
}
}

View File

@@ -0,0 +1,67 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
namespace NUnit.Framework.Extensions
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class RowAttribute : Attribute
{
private string _testName;
private object[] _arguments;
private string _description;
private Type _expectedExceptionType;
private string _exceptionMessage;
public RowAttribute(object argument1)
{
_arguments = new object[] { argument1 };
}
public RowAttribute(object argument1, object argument2)
{
_arguments = new object[] { argument1, argument2 };
}
public RowAttribute(object argument1, object argument2, object argument3)
{
_arguments = new object[] { argument1, argument2, argument3 };
}
public RowAttribute(params object[] arguments)
{
_arguments = arguments;
}
public string TestName
{
get { return _testName; }
set { _testName = value; }
}
public object[] Arguments
{
get { return _arguments; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
public Type ExpectedException
{
get { return _expectedExceptionType; }
set { _expectedExceptionType = value; }
}
public string ExceptionMessage
{
get { return _exceptionMessage; }
set { _exceptionMessage = value; }
}
}
}

View File

@@ -0,0 +1,13 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
namespace NUnit.Framework.Extensions
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class RowTestAttribute : Attribute
{
}
}

View File

@@ -0,0 +1,13 @@
// *********************************************************************
// Copyright 2007, Andreas Schlapsi
// This is free software licensed under the MIT license.
// *********************************************************************
using System;
namespace NUnit.Framework.Extensions
{
public enum SpecialValue
{
Null = 1
}
}

Some files were not shown because too many files have changed in this diff Show More