Skip to content

Instantly share code, notes, and snippets.

@harriyott
Created October 24, 2013 13:25
Show Gist options
  • Save harriyott/7137271 to your computer and use it in GitHub Desktop.
Save harriyott/7137271 to your computer and use it in GitHub Desktop.
Unit test to validate all controllers can bind
[TestMethod]
public void Can_create_controllers()
{
var kernel = new StandardKernel();
SiteResolver.RegisterComponents(kernel);
typeof(AccountController)
.Assembly
.GetTypes()
.Where(t => typeof(Controller).IsAssignableFrom(t))
.ToList()
.ForEach(c => kernel.Get(c));
Assert.IsTrue(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment