private async void BeUniqueByName_Update_Not_Exists() { Mock <ITagSetRepository> tagSetRepository = new Mock <ITagSetRepository>(); tagSetRepository.Setup(x => x.ByName(It.IsAny <string>())).Returns(Task.FromResult <TagSet>(null)); var validator = new ApiTagSetRequestModelValidator(tagSetRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiTagSetRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.Name, "A"); }
public async void Name_Update_length() { Mock <ITagSetRepository> tagSetRepository = new Mock <ITagSetRepository>(); tagSetRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new TagSet())); var validator = new ApiTagSetRequestModelValidator(tagSetRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiTagSetRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 201)); }