Created
May 19, 2011 15:27
-
-
Save Ang3lFir3/981023 to your computer and use it in GitHub Desktop.
NSpec NUnit Shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class DebuggerShim | |
{ | |
[Test] | |
public void AllTests() | |
{ | |
var finder = new ShimFinder(typeof(DebuggerShim).Assembly.GetTypes()); | |
var builder = new ContextBuilder(finder, new DefaultConventions()); | |
var runner = new ContextRunner(builder); | |
runner.Run(); | |
if (runner.Failures().Count() != 0) | |
Assert.Fail("Some NSpec test failed"); | |
} | |
} | |
public class ShimFinder : ISpecFinder | |
{ | |
private Type[] types; | |
public ShimFinder(Type[] types) | |
{ | |
this.types = types; | |
} | |
public IEnumerable<Type> SpecClasses() | |
{ | |
return types; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears the API has changed some. Is there an easy way to do this now, as I don't see the Failures available from the ContextRunner class??