I'm participating in a project using ASP.NET MVC 3 and DataAnnotations. We have DataAnnotations in ViewModels classes.
How do you write unit tests for these validations?
ViewModel example:
public class AchievementVM
{
[Required(ErrorMessage = "The title field is required.")]
[StringLength(100, ErrorMessage = "Title must be 100 characters or less.")]
public string Title { get; set; }
}
Thanks!