Skip to content

Instantly share code, notes, and snippets.

@raybooysen
Created January 13, 2015 09:11
Show Gist options
  • Save raybooysen/5cf4c9b74a7d35d9ba0b to your computer and use it in GitHub Desktop.
Save raybooysen/5cf4c9b74a7d35d9ba0b to your computer and use it in GitHub Desktop.
Shouldy Example
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; }
}
}
@raybooysen
Copy link
Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment