Skip to content
  • Home
  • About

Look on my works, ye Mighty, and despair!

Generics

Testing generic methods with MbUnit

December 21, 2011Graham HayLeave a comment

Testing generic methods with different types is just as easy as anything else, with MbUnit:

[Test]
[Row(typeof(string))]
[Row(typeof(int))]
public void GenericTest<T>()
{
    GenericMethod<T>();
}

public void GenericMethod<T>()
{
    Console.WriteLine("T: {0}", typeof (T).FullName);
}
Generics, MbUnit, Unit Testing

Category Cloud

Ansible AWS Bootstrap Cowboy Deployment Docker Elm Erlang Express.js gen_statem Golang JavaScript jenkins Lambda Logging MbUnit Node.js NuGet OpenRasta Postgresql PowerShell Redshift ReSharper StructureMap Syn TeamCity Testing TLA+ Unit Testing VirtualBox

Top Posts & Pages

  • Using promises with node-pg
  • Filtering a CSV in R
  • It's a Syn (Part 1)
  • It's a Syn (Part 9)

Recent Posts

  • Add newlines to Firehose transform lambda
  • Flattening json arrays, with Athena
  • Using SSM with Ansible
  • Batch closing PRs
  • Cross-region pull for a lambda function
Blog at WordPress.com.
  • Subscribe Subscribed
    Look on my works, ye Mighty, and despair!

    Have a WordPress.com account? Log in now.

  • Look on my works, ye Mighty, and despair!
    View site in Reader
    Manage subscriptionsSign upLog in
    Report this content
    Collapse this bar