public async void ProjectId_Update_length() { Mock <IChannelRepository> channelRepository = new Mock <IChannelRepository>(); channelRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new Channel())); var validator = new ApiChannelRequestModelValidator(channelRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiChannelRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.ProjectId, new string('A', 51)); }
private async void BeUniqueByNameProjectId_Update_Not_Exists() { Mock <IChannelRepository> channelRepository = new Mock <IChannelRepository>(); channelRepository.Setup(x => x.ByNameProjectId(It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult <Channel>(null)); var validator = new ApiChannelRequestModelValidator(channelRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiChannelRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.Name, "A"); }