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

  • Disk by id
  • Column aliases are not supported (Redshift)
  • Resetting all sequences in postgresql
  • Converting an AWS Lambda to an ECS Task
  • Ansible & systemctl daemon-reload

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!
    • Already have a WordPress.com account? Log in now.
    • Look on my works, ye Mighty, and despair!
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar