Skip to content

Commit

Permalink
Added NUnit [Any] attribute extension
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek-galezowski committed Oct 20, 2013
1 parent 3baed3a commit 1315ef6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions TddToolkit/NUnitExtensions/AnyAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using NUnit.Framework;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace TddEbook.TddToolkit.NUnitExtensions
{
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class AnyAttribute : ParameterDataAttribute
{
public override IEnumerable GetData(ParameterInfo parameter)
{
return new[] { Any.Instance(parameter.ParameterType)};
}
}
}
4 changes: 4 additions & 0 deletions TddToolkit/TddToolkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<Reference Include="KellermanSoftware.Compare-NET-Objects">
<HintPath>..\Lib\Compare-NET-Objects-SourceV1.7.2\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\Lib\NUnit-2.6.2\bin\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="Ploeh.AutoFixture">
<HintPath>..\Lib\AutoFixture\Ploeh.AutoFixture.dll</HintPath>
Expand All @@ -52,6 +55,7 @@
<Compile Include="ImplementationDetails\ArrayWithIndex.cs" />
<Compile Include="ImplementationDetails\TypeResolution\LimitedFakeChain.cs" />
<Compile Include="ImplementationDetails\LatestArraysWithPossibleValues.cs" />
<Compile Include="NUnitExtensions\AnyAttribute.cs" />
<Compile Include="XAssert.ObjectGraph.cs" />
<Compile Include="Helpers\FluentAssertions\FluentAssertionExtensions.cs" />
<Compile Include="XAssert.Simple.cs" />
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions TddToolkitSpecification/AnySpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text.RegularExpressions;
using NUnit.Framework;
using TddEbook.TddToolkit;
using TddEbook.TddToolkit.NUnitExtensions;

namespace TddToolkitSpecification
{
Expand Down

0 comments on commit 1315ef6

Please sign in to comment.