public async void VariableSetId_Update_length() { Mock <ILibraryVariableSetRepository> libraryVariableSetRepository = new Mock <ILibraryVariableSetRepository>(); libraryVariableSetRepository.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(new LibraryVariableSet())); var validator = new ApiLibraryVariableSetRequestModelValidator(libraryVariableSetRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiLibraryVariableSetRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.VariableSetId, new string('A', 151)); }
private async void BeUniqueByName_Update_Exists() { Mock <ILibraryVariableSetRepository> libraryVariableSetRepository = new Mock <ILibraryVariableSetRepository>(); libraryVariableSetRepository.Setup(x => x.ByName(It.IsAny <string>())).Returns(Task.FromResult <LibraryVariableSet>(new LibraryVariableSet())); var validator = new ApiLibraryVariableSetRequestModelValidator(libraryVariableSetRepository.Object); await validator.ValidateUpdateAsync(default(string), new ApiLibraryVariableSetRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, "A"); }