public async void TweetTweetId_Create_Valid_Reference() { Mock <IRetweetRepository> retweetRepository = new Mock <IRetweetRepository>(); retweetRepository.Setup(x => x.TweetByTweetTweetId(It.IsAny <int>())).Returns(Task.FromResult <Tweet>(new Tweet())); var validator = new ApiRetweetServerRequestModelValidator(retweetRepository.Object); await validator.ValidateCreateAsync(new ApiRetweetServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.TweetTweetId, 1); }
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); }