Skip to content

Commit

Permalink
Merge pull request #43 from Nix-code/feat/nishantb/dbcontext
Browse files Browse the repository at this point in the history
test: fix EmailModel unit test
  • Loading branch information
nixhantb authored Dec 18, 2023
2 parents 341ee7f + 5a57c30 commit 7a19cb8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public void EmailModel_ShouldValidateAnnotations()

var ValidateResults = ValidateAnnotationHelper.ValidateModel(emailModel);

Assert.Null(emailModel.EmailType);
Assert.NotNull(emailModel.EmailType);
Assert.Null(emailModel.EmailAddress);
Assert.True(ValidateResults.Any(v => v.MemberNames.Contains("EmailType") && v.ErrorMessage.Contains("Email Type is required")), "Email Type should be marked as required");
Assert.False(ValidateResults.Any(v => v.MemberNames.Contains("EmailType") && v.ErrorMessage.Contains("Email Type is required")), "Email Type should be marked as required");
Assert.True(ValidateResults.Any(v => v.MemberNames.Contains("EmailAddress") && v.ErrorMessage.Contains("Email Address is required")), "Email Address should be marked as required");
}

Expand Down

0 comments on commit 7a19cb8

Please sign in to comment.