diff --git a/SpecificationTestPatterns/InstancePerClassConvention.cs b/SpecificationTestPatterns/InstancePerClassConvention.cs new file mode 100644 index 0000000..fb2dbbe --- /dev/null +++ b/SpecificationTestPatterns/InstancePerClassConvention.cs @@ -0,0 +1,20 @@ +namespace SpecificationTestPatterns +{ + using System.Linq; + using Fixie; + using FluentAssertions; + using Xunit; + + public class InstancePerClassConvention : Convention + { + public InstancePerClassConvention() + { + Classes.Where(t => t.Name.StartsWith("When_") && + t.Methods().SelectMany(m => m.GetCustomAttributes(typeof(FactAttribute), false)).Any()); + + Methods.Where(method => method.IsPublic && (method.IsVoid() || method.IsAsync())); + + ClassExecution.CreateInstancePerClass(); + } + } +} \ No newline at end of file diff --git a/SpecificationTestPatterns/SpecificationTestPatterns.csproj b/SpecificationTestPatterns/SpecificationTestPatterns.csproj index af7dbf9..aa3d5c1 100644 --- a/SpecificationTestPatterns/SpecificationTestPatterns.csproj +++ b/SpecificationTestPatterns/SpecificationTestPatterns.csproj @@ -1,6 +1,5 @@  - @@ -13,7 +12,7 @@ SpecificationTestPatterns v4.5.2 512 - 8a22513f + 7460a358 true @@ -33,6 +32,10 @@ 4 + + ..\packages\Fixie.1.0.0.15\lib\net45\Fixie.dll + True + ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.dll True @@ -60,10 +63,6 @@ ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll True - - ..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll - True - ..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll True @@ -71,6 +70,7 @@ + @@ -90,7 +90,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. -