Created
January 13, 2015 09:11
-
-
Save raybooysen/5cf4c9b74a7d35d9ba0b to your computer and use it in GitHub Desktop.
Shouldy Example
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using NUnit.Framework; | |
using Shouldly; | |
namespace ClassLibrary1 | |
{ | |
[TestFixture] | |
public class Fixture | |
{ | |
private IEnumerable<Foo> AllTypes | |
{ | |
get | |
{ | |
yield return new Foo(true); | |
yield return new Foo(false); | |
} | |
} | |
[TestCaseSource("AllTypes")] | |
public void AllValuesShouldBeBar(Foo foo) | |
{ | |
foo.IsBar.ShouldBe(false); | |
} | |
} | |
public class Foo | |
{ | |
public Foo(bool isBar) | |
{ | |
IsBar = isBar; | |
} | |
public bool IsBar { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Done!