public async void Blocked_Create_length() { Mock <IFollowerRepository> followerRepository = new Mock <IFollowerRepository>(); followerRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Follower())); var validator = new ApiFollowerRequestModelValidator(followerRepository.Object); await validator.ValidateCreateAsync(new ApiFollowerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Blocked, new string('A', 2)); }
public async void FollowRequestStatu_Create_null() { Mock <IFollowerRepository> followerRepository = new Mock <IFollowerRepository>(); followerRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Follower())); var validator = new ApiFollowerRequestModelValidator(followerRepository.Object); await validator.ValidateCreateAsync(new ApiFollowerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.FollowRequestStatu, null as string); }
public async void FollowingUserId_Create_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 ApiFollowerRequestModelValidator(followerRepository.Object); await validator.ValidateCreateAsync(new ApiFollowerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.FollowingUserId, 1); }