public async void RetwitterUserId_Update_Valid_Reference() { Mock <IRetweetRepository> retweetRepository = new Mock <IRetweetRepository>(); retweetRepository.Setup(x => x.UserByRetwitterUserId(It.IsAny <int>())).Returns(Task.FromResult <User>(new User())); var validator = new ApiRetweetServerRequestModelValidator(retweetRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiRetweetServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.RetwitterUserId, 1); }
public async void TweetTweetId_Update_Invalid_Reference() { Mock <IRetweetRepository> retweetRepository = new Mock <IRetweetRepository>(); retweetRepository.Setup(x => x.TweetByTweetTweetId(It.IsAny <int>())).Returns(Task.FromResult <Tweet>(null)); var validator = new ApiRetweetServerRequestModelValidator(retweetRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiRetweetServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.TweetTweetId, 1); }