Skip to content

Instantly share code, notes, and snippets.

@plioi
Created October 15, 2013 16:27
Show Gist options
  • Save plioi/6994379 to your computer and use it in GitHub Desktop.
Save plioi/6994379 to your computer and use it in GitHub Desktop.
public class ParameterizedTests
{
public void TestWithNoParameters()
{
Console.WriteLine("TestWithNoParameters");
Console.WriteLine();
}
public void TestWithInterestingParameter(Person person)
{
Console.WriteLine("TestWithInterestingParameter");
Console.WriteLine(" Person: " + person);
Console.WriteLine();
}
//Something fishy about this new test!
public void TestWithDateTimeParameterNeverGetsCalled(DateTime dateTime)
{
Console.WriteLine("This test method is never called, and has no effect on the test run's output!");
}
public static IEnumerable<Person> People()
{
yield return new Person { Name = "Arthur Vandelay", BirthDay = new DateTime(1980, 1, 1) };
yield return new Person { Name = "Kel Varnsen", BirthDay = new DateTime(1978, 1, 1) };
}
public static IEnumerable<Person> MorePeople()
{
yield return new Person { Name = "Martin Van Nostrand", BirthDay = new DateTime(1995, 1, 1) };
yield return new Person { Name = "H.E. Pennypacker", BirthDay = new DateTime(1920, 1, 1) };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment