public async void Content_Update_length() { Mock <IDirectTweetRepository> directTweetRepository = new Mock <IDirectTweetRepository>(); directTweetRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new DirectTweet())); var validator = new ApiDirectTweetServerRequestModelValidator(directTweetRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiDirectTweetServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Content, new string('A', 141)); }
public async void TaggedUserId_Update_Valid_Reference() { Mock <IDirectTweetRepository> directTweetRepository = new Mock <IDirectTweetRepository>(); directTweetRepository.Setup(x => x.UserByTaggedUserId(It.IsAny <int>())).Returns(Task.FromResult <User>(new User())); var validator = new ApiDirectTweetServerRequestModelValidator(directTweetRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiDirectTweetServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.TaggedUserId, 1); }