Skip to content

Instantly share code, notes, and snippets.

@Vintharas
Created March 2, 2015 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vintharas/f0d29f39662f282d6ca0 to your computer and use it in GitHub Desktop.
Save Vintharas/f0d29f39662f282d6ca0 to your computer and use it in GitHub Desktop.
AutoFixture MVC Controller Customization
public static class ModelStateTestHelpers
{
public static bool HasError(this ModelStateDictionary modelState, string errorMessage)
{
return modelState.Any(ms => ms.Value.Errors.Any(e => e.ErrorMessage == errorMessage));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment