public async void FollowRequestStatu_Update_null() { Mock <IFollowerRepository> followerRepository = new Mock <IFollowerRepository>(); followerRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Follower())); var validator = new ApiFollowerServerRequestModelValidator(followerRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiFollowerServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.FollowRequestStatu, null as string); }
public async void FollowingUserId_Update_Valid_Reference() { Mock <IFollowerRepository> followerRepository = new Mock <IFollowerRepository>(); followerRepository.Setup(x => x.UserByFollowingUserId(It.IsAny <int>())).Returns(Task.FromResult <User>(new User())); var validator = new ApiFollowerServerRequestModelValidator(followerRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiFollowerServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.FollowingUserId, 1); }