public async void ReplierUserId_Create_Valid_Reference() { Mock <IReplyRepository> replyRepository = new Mock <IReplyRepository>(); replyRepository.Setup(x => x.UserByReplierUserId(It.IsAny <int>())).Returns(Task.FromResult <User>(new User())); var validator = new ApiReplyServerRequestModelValidator(replyRepository.Object); await validator.ValidateCreateAsync(new ApiReplyServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.ReplierUserId, 1); }
public async void Content_Create_length() { Mock <IReplyRepository> replyRepository = new Mock <IReplyRepository>(); replyRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Reply())); var validator = new ApiReplyServerRequestModelValidator(replyRepository.Object); await validator.ValidateCreateAsync(new ApiReplyServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Content, new string('A', 141)); }