1

I'm using Nunit as my unit testing framework and I've created a couple of L2S entities and validation classes. Now I want to unit test the validation, but I can't figure out how to do that.

This is my validation class:

[Bind(Exclude = "ProjectID")]
public class ProjectValidation {

    [Required(ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = "RequiredProjectName")]
    [LocalizedDisplayName("ProjectName", NameResourceType = typeof(ValidationMessages))]
    public string Name { get; set; }

    [LocalizedDisplayName("StartDate", NameResourceType = typeof(ValidationMessages))]
    public DateTime StartDate { get; set; }

    [Required(ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = "RequiredCustomer")]
    [LocalizedDisplayName("Customer", NameResourceType = typeof(ValidationMessages))]
    public int FK_CustomerId { get; set; }

    [LocalizedDisplayName("StartDate", NameResourceType = typeof(ValidationMessages))]
    public String Contact { get; set; }

}

And this is my Entity:

[MetadataType(typeof(ProjectValidation))]
public partial class Project : IEntity {
}
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.